seam-lang
v2.0.5
Published
A small reasoning language with ISO Prolog-compatible surface syntax.
Readme
Seam
Seam is a small reasoning language for turning facts and rules into answers and proofs.
Prolog-like syntax. Small core. Inspectable results.
The name comes from the way reasoning joins things together: facts with rules, goals with answers, and answers with proofs.
Install and run
Seam has no runtime npm dependencies and no build step. From a source checkout, run the CLI directly with Node.js 18 or newer:
node bin/seam.js examples/ancestor.pl
node bin/seam.js --proof examples/socrates.pl
node bin/seam.js --warnings test/conformance/warnings/negation/unstratified_mutual.pl
printf 'works(stdin, true) :- eq(ok, ok).\n' | node bin/seam.js -For one-off local CLI use from the checkout, npm can run the package bin without a manual symlink:
npm exec -- seam --version
npm exec -- seam examples/ancestor.plTo install the checkout's seam command on your PATH, use npm's package link:
npm link
seam --versionJavaScript API
import { run, Program, Solver } from 'seam';
const result = run(`
materialize(answer, 1).
answer(ok) :- eq(ok, ok).
`);
console.log(result.stdout);Documentation
For local browser use, serve the checkout first so the playground can load ES modules and example files:
python3 -m http.server
# then open http://localhost:8000/playground.htmlTests
npm test
npm run test:conformance
npm run conformance:report
# release preparation writes conformance-report.md via the preversion script
npm run test:examples
npm run test:regression