SNAPKITTYWEST's picture
Relicense under the Sovereign Leviathan covenant; remove MIT and Apache
055a27e verified
Raw History Blame Contribute Delete
2.65 kB
// SPDX-License-Identifier: LicenseRef-Sovereign-Leviathan-SL-AGPL3-001
// Copyright (C) 2026 SNAPKITTYWEST / Sovereign Kernel Project
// CLONE_GATE: icp-dag-crystallizer::datalog::rules
//
// ICP-DAG v1.0 β€” Derivation rules (SoufflΓ© Datalog)
#include "facts.dl"
// ── R1: Proven β€” a claim is proven if a proof edge exists ────────────────────
.decl proven(claim: NodeId)
proven(C) :-
node(P, "PROOF", "proven"),
edge(C, P, "proven-by").
// ── R2: Authorized β€” decision authorized iff backing claim is proven ─────────
.decl authorized(decision: NodeId)
authorized(D) :-
node(D, "DECISION", "authorized"),
node(C, "CLAIM", "verified"),
edge(C, D, "decides"),
proven(C).
// ── R3: Can execute β€” execution requires authorized decision ─────────────────
.decl can_execute(execution: NodeId)
can_execute(E) :-
node(E, "EXECUTION", "pending"),
node(D, "DECISION", "authorized"),
edge(D, E, "executes").
// ── R4: Reachability (transitive closure) ────────────────────────────────────
.decl reachable(x: NodeId, y: NodeId)
reachable(X, Y) :- edge(X, Y, _).
reachable(X, Z) :- edge(X, Y, _), reachable(Y, Z).
// ── R5: Cycle detection ──────────────────────────────────────────────────────
.decl cycle(x: NodeId)
cycle(X) :- reachable(X, X).
// ── R6: Edge type validation ─────────────────────────────────────────────────
.decl edge_type_valid(from: NodeId, to: NodeId, etype: EdgeType)
edge_type_valid(F, T, E) :-
edge(F, T, E),
node(F, FType, _),
node(T, TType, _),
edge_schema(E, FType, TType).
// ── R7: Constraint satisfaction ──────────────────────────────────────────────
.decl constraint_satisfied(cid: symbol)
constraint_satisfied(CID) :-
constraint(CID, _, _),
!constraint_violated(CID).
.decl constraint_violated(cid: symbol)
// Populated by invariant checks below
// ── R8: Policy active ────────────────────────────────────────────────────────
.decl policy_active(pid: symbol)
policy_active(PID) :-
policy(PID, _),
node(_, "POLICY", "active").