eyeprolog

中文文档
1.6.44发布于 2026/11/03MITTypeScriptES Module零依赖构建来源已验证

EyeProlog turns facts and rules into answers and proofs.

原始使用文档
文档目录6 节
  1. Twenty years of EYE, and the next twenty years
  2. Quick start
  3. Links
  4. RDF, Prolog, and symbiotic knowledge graphs
  5. Performance
  6. Development

EyeProlog

npm version DOI

EyeProlog turns portable ISO Prolog programs into answers and inspectable proofs.

Read The Art of EyeProlog
Click the cover to read The Art of EyeProlog.

The single implementation reference is The Art of EyeProlog. It documents the language, built-ins, libraries, command line, JavaScript API, examples, proofs, conformance profile, and implementation.

Twenty years of EYE, and the next twenty years

The Euler project began in 2001 and became EYE, a Prolog-based reasoner, in 2006; it is still alive in 2026. In a symbolic way, EYE remembers Leonhard Euler, who lost sight in one eye. The Retina project began in 2021 and became EyeProlog in 2026; we hope to keep it growing for the next twenty years. That continuation offers a second quiet remembrance of Euler, who later lost sight in his other eye—while the project keeps trying to see farther through logic, proof, and reasoning.

Quick start

EyeProlog requires Node.js 18 or newer:

node --version

If necessary, upgrade through a Node version manager or the official Node.js download.

Run EyeProlog without installing it globally:

npx --yes eyeprolog
?- member(X, [prolog, logic]).
   X = prolog
;  X = logic.
?- halt.

For a persistent command, use a user-owned npm prefix:

npm install --global --prefix "$HOME/.local" eyeprolog
export PATH="$HOME/.local/bin:$PATH"
eyeprolog

Add the PATH export to your shell startup file. Do not use sudo npm install; npm's EACCES guidance also recommends a Node version manager or a user-owned prefix.

Run a program non-interactively:

printf 'human(socrates).\nmortal(X) :- human(X).\n' |
  npx --yes eyeprolog --proof --goal 'mortal(socrates)' -

Or play the answer out as a dialogue, with the proof checker as the opponent:

printf 'human(socrates).\nmortal(X) :- human(X).\n' |
  npx --yes eyeprolog --dialogue --goal 'mortal(socrates)' -

RDF, Prolog, and symbiotic knowledge graphs

EyeProlog can sit behind an RDF knowledge graph without inventing a private graph representation. rdf-interchange converts RDF 1.2 datasets to ordinary rdf(Subject, Predicate, Object, Graph) facts, EyeProlog applies portable rules, and ground rdf/4 results can be converted back to RDF.

The checked Symbiotic Knowledge Graphs example uses named graphs and RDF 1.2 triple terms to distinguish trusted knowledge, AI-proposed statements, and human review. Its wide-audience companion explains why this is a useful present-day software model for human/AI/KG co-evolution: RDF supplies shared semantic memory, Prolog supplies explicit deliberation, AI supplies new hypotheses, and people remain participants in meaning and judgment.

The same RDF → Prolog → RDF boundary is exercised by five additional checked scenarios: cross-organization data sharing, explainable EV-depot configuration, operational incident response, software supply-chain vulnerability response, and a scientific evidence graph. Together they cover policy decisions, reversible configuration reasoning, dependency-graph diagnosis, transitive SBOM exposure, and evidence aggregation with explicit disagreement.

Performance

EyeProlog does not carry a separate wall-clock benchmark harness. npm test's own elapsed time, run across thousands of conformance, regression, and example programs, is the coarse performance indicator instead — a real slowdown shows up there. OpenRuleBench remains a dedicated, checked correctness-and-scale benchmark for the Datalog rule-engine profile specifically. For the project policy on post-ISO-standard and WG17 compatibility features such as digit separators, see ISO/WG17 compatibility extensions.

Development

git clone https://github.com/eyereasoner/eyeprolog.git
cd eyeprolog
npm install
npm test

The npm command list is deliberately small:

  • npm test (or npm run test): run the release gate, including live upstream conformity checks (WG17 syntax among them).
  • npm run neumerkel: re-fetch the upstream Neumerkel conformity sources and fail if the tracked report no longer matches them. The release gate reports that drift as a warning; this command makes it an error, so it answers "are we still current?" on its own.

Use npm test -- --offline for a network-free local pass (this also skips the live-discovered WG17 syntax check, since it has no offline snapshot). Focused checks remain available directly, for example node test/run-regression.mjs docs; see test runners. The automatic version hooks rebuild generated library and book files, run the release gate, refresh and stage conformance reports, and push the release. Detailed upstream report maintenance is documented in the conformance guide.

EyeProlog is released under the MIT License.

版本与发布记录

eyeprolog 共发布 359 个版本,首次发布于 2026/08/07;过去 12 个月发布了 359 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.6.44latest2026/11/03今天
1.6.432026/11/012 天前
1.6.422026/10/1817 天前
1.6.412026/10/1222 天前
1.6.402026/10/1223 天前
1.6.392026/10/1223 天前

关于 eyeprolog 的常见问题

eyeprolog 是什么?

EyeProlog将事实和规则转化为答案和证明。

如何安装 eyeprolog?

在项目目录运行 npm install eyeprolog,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 eyeprolog,可以用 npx eyeprolog 直接运行。

eyeprolog 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

eyeprolog 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

eyeprolog 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

eyeprolog 可以商用吗?

eyeprolog 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

eyeprolog 还在维护吗?

最新版本 1.6.44 发布于 2026/11/03(今天);至今共发布 359 个版本,其中过去 12 个月发布了 359 个;首次发布于 2026/08/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。