Home / Projects / Orchestrata Ultimate / Decisions / ADR index / ADR-0027

ADR-0027: Retain Prolog as the reasoning engine

field value
Status Accepted
Date 2026-07-24
Register factory (docs/adr, 4-digit ids)
Source docs/adr/0027-retain-prolog-as-the-reasoning-engine.md — permalink at bdafa201a (unchanged on master since that commit)
Wiki register entry ADR-0027 (wiki status: Accepted)

← ADR-0026 · ADR-0028 →

The record

Context

ADR-0025 bans dynamic predicate construction in the governance rulebase, and closed with an open question: production policy engines enforce those restrictions natively, so is Prolog the right engine at all? Soufflé requires stratified negation and guarantees termination absent function symbols; OPA/Rego rejects recursion outright and imposes safety rules on every head and negated-goal variable; Cedar cuts expressiveness to a decidable SMT fragment with Lean-verified soundness. On that reading, ADR-0006's projection-completeness check and ADR-0010's stratification lint are reimplementations of a static checker that ships in the box.

That reasoning was drawn from the spec, not the code. Surveying the actual rulebases changes it.

What the codebase actually contains (SWI-Prolog 10.1.9, Janus bridge, 16 rulebases / ~3,096 lines):

Against that, the candidates:

Engine Recursion Negation Incremental re-evaluation Static checks shipped In-process Python
SWI-Prolog (current) unbounded NAF, unchecked yes — incremental tabling none yes, Janus
Soufflé (Datalog) yes, terminating stratification enforced no strong no — batch compiler, CSV/SQLite facts
OPA / Rego rejected outright safe by construction no strong sidecar / HTTP
Cedar no n/a n/a Lean-verified SMT fragment via SDK
clingo / ASP yes well-founded / stable models no grounding checks yes
XSB yes well-founded semantics yes none yes (Janus originated there)

Decision

Retain SWI-Prolog. Build the one genuinely missing static check (ADR-0010's stratification lint, extended per ADR-0025) rather than migrate the engine.

Alternatives rejected

Consequences

Provenance

The engine question was raised by the 2026-07-24 prior-art research and recorded as an open note in ADR-0025. Resolved by surveying the existing rulebases, which showed the discipline largely already practised and incremental tabling already deployed. Ratified by the human, who directed: "stay on prolog".

Relations of ADR-0027

Rulings cited

None.

Specs cited