Factoidal — RIF Core forward-chaining demo

A small Horn-clause rule engine, F*-verified, running live in your browser — no build-time canned output.
Loading engine…

RIF Core (Rule Interchange Format Core dialect) is a Horn-clause sublanguage standardised by the W3C. The Factoidal implementation covers the operational fragment relevant to RDF: triples, frames, membership (#), and subclass (##) atoms; rules are Forall vars (head :- body) with conjunctive bodies. Equality, built-ins, and the import / dialect-mixing machinery are out of scope.

The engine in RIF.Core.Eval.fst performs naive forward chaining with set semantics. One round = fire every rule once against the current graph; a fuel parameter caps the number of rounds. The saturation lemma (lemma_fixpoint_extends) is proved: forward chaining never removes a triple.

What the engine is not: full RIF (no Core-Plus dialects, no BLD / PRD, no built-ins beyond term equality, no skolemisation, no <Import> resolution). The body translator delegates to SPARQL11.Algebra.eval_bgp, so rule bodies are evaluated as basic graph patterns; this matches the standard operational reading of RIF Core under simple entailment.

Smoke test: RIF.Core.Eval.fst's own program

This runs the exact smoke_input_graph / smoke_program baked into RIF.Core.Eval.fst, saturated live via RIF_Core_Eval.fixpoint in the js_of_ocaml bundle — the same F* function the module's own assert_norm checks exercise at compile time, called fresh in your browser. No user input; a fixed capability probe.

Ready.

Try your own RIF program

Edit the RIF-XML rules and the Turtle premise data below, then run inference. The Turtle is parsed to N-Quads by the engine's own Turtle parser (Parser.Turtle.fst, via the parseToDatasetJson ABI export already used by the SPARQL demos); the RIF-XML is parsed by Parser.RIFXML.fst; saturation is RIF_Core_Eval.fixpoint — the same live call the smoke test above makes, just with your program and data instead of the fixed one.

Ready.

What's actually running

Caveat

Parser and algebra spec verified in F*; on-disk backend has unverified OCaml-side optimization layers being migrated back to F* (see fstar-purity-unwind.md). The RIF Core engine itself is pure F* with no assume val holes.

RIF Core is scoped out of the entailment-regime test suite (see docs/claude-rules/scope.md): the four W3C SPARQL 1.1 ent:RIF tests (rif01, rif03, rif04, rif06) are permanent SKIPs, not fails, because RIF Core is "a separate production-rule language layered on RDF, not an entailment regime that fits into a verified SPARQL/OWL-RL closure loop." This demo exists to show the engine works, not to claim those tests pass.