eyelang
v0.1.10
Published
A small Prolog-syntax-subset logic programming language for rules, goals, answers, and proofs.
Readme
Eyelang
Eyelang is a small logic programming language for rules, goals, answers, and proofs. Its source syntax is a deliberately small subset of ordinary Prolog term and Horn-clause syntax. It grew out of logic-language experiments in the EYE/N3 reasoning tradition, but is packaged here as its own project.
Install and run
Eyelang 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/eyelang.js examples/ancestor.pl
node bin/eyelang.js --proof examples/socrates.pl
printf 'works(stdin, true) :- eq(ok, ok).\n' | node bin/eyelang.js -For one-off local CLI use from the checkout, npm can run the package bin without a manual symlink:
npm exec -- eyelang --version
npm exec -- eyelang examples/ancestor.plTo install the checkout's eyelang command on your PATH, use npm's package link:
npm link
eyelang --versionJavaScript API
import { run, Program, Solver } from 'eyelang';
const result = run(`
materialize(answer, 1).
answer(ok) :- eq(ok, ok).
`);
console.log(result.stdout);Documentation
Tests
npm test
npm run test:conformance
npm run test:examples
npm run test:regression