Download src/datalog/rules.dl from Snapkitty/icp-dag-crystallizer: direct link, hf CLI and curl.
- Browser
- Download file 2.65 kB
-
https://huggingface.co/Snapkitty/icp-dag-crystallizer/resolve/main/src/datalog/rules.dl
- Command line
-
hf download hf://Snapkitty/icp-dag-crystallizer/src/datalog/rules.dl
-
curl -L -o rules.dl https://huggingface.co/Snapkitty/icp-dag-crystallizer/resolve/main/src/datalog/rules.dl
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"). | |