[ DETERMINISTIC ]
bounded fixed-point evaluation
- semi-naive evaluation
- stratified negation
- reproducible results
Embedded Datalog micro-kernel
Engine v0.1.0-alpha.1 · deterministic logic
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.
[ DETERMINISTIC ]
bounded fixed-point evaluation
[ ZERO-MALLOC ]
bounded memory discipline

[ AUDITABLE ]
every decision is attributable
[ PORTABLE ]
embed in your runtime
Delta-driven iteration with IDB current/delta/merge windows. Derives only what changed — no redundant recomputation.
allow(R) :- safe_source(R), has_text(R).Greedy deterministic body planner with uint64_t masks. For semi-naive variants, the delta literal is the fixed root.
build_static_join_order(rule, delta_idx, order, &count)Iterative stratum assignment, frozen lower-stratum IDB windows, bsearch lookup. Negative cycles rejected at load time.
deny(R) :- request(R), not(approved(R)).Solver, lexer, and parser use bounded stack arrays only. One calloc for the solve result — nothing on the decision path.
_Static_assert(sizeof(solve_result_t) <= BOUND, "...");Every policy gets a cryptographic fingerprint at load time. Receipts carry the hash — decisions are fully attributable.
maelys_sha256_hex(policy_src, src_len, ruleset->sha256);No policy means deny. Parse errors deny. Solver errors deny. Unbound variables in not() rejected statically.
int maelys_datalog_ruleset_has_allow_all(...) { return 0; }# Static library clang -o myapp main.c \ -Imaelys-dl/include \ libmaelys_datalog.a
maelys_datalog_manifest_load_ex( "policies/main.json", 0, &policy_set, &diag );
maelys_datalog_solve_once( &ruleset, &edb, &result ); // Query the decision bool allow = query_solved( result, "allow", terms, 1 );
Write a Datalog policy, add EDB facts, and watch the engine derive decisions — no install required.
Open playground →