- semi-naive evaluation
- stratified negation
- reproducible results
Embedded policy engine
MaelysDatalog
MODEL · DERIVE · DECIDE
Datalog release · v0.11.1 · 2026-09-26 · release →
I do not predict.
I organize the possible.
A bounded Datalog policy engine in pure C for systems where every decision must remain understandable, reproducible, and auditable.
- SHA-256 policy identity
- fail-closed loading
- deterministic diagnostics
- stack-bounded solver
- no heap on hot path
- reusable session storage
- C11 static library
- Python & JavaScript
- WASM / WASI


Engine
From rules to decisions
Semi-naive evaluation
Delta-driven iteration derives only what changed instead of recomputing the whole fixed point.
allow(R) :- safe_source(R), has_text(R).Static join ordering
A deterministic bounded planner orders rule bodies before evaluation.
build_static_join_order(rule, delta_idx, order, &count)Stratified negation
Negative cycles are rejected at load time and lower strata remain frozen during evaluation.
deny(R) :- request(R), not(approved(R)).Zero-malloc hot path
The reference session reserves bounded working storage at creation and reuses it across requests. Solving itself does not allocate.
fixed bounds · explicit failureSHA-256 policy identity
Every loaded policy carries the fingerprint of the exact source that produced its decisions.
policy source → digest → rulesetFail-closed by design
Missing policies, parse failures, solver errors and unauthorized queries all resolve to denial.
error ≠ authorization