Walk a chain with strict recursion
Intention
Section titled “Intention”I want to derive reachability along a finite chain of relations.
Incorrect form and why it stays silent
Section titled “Incorrect form and why it stays silent”A recursive bare reader forms a status cycle:
when reach(a, b) and edge(b, c);then reach(a, c);Correct form
Section titled “Correct form”language "law.core" version "0.2";package recipes.v.r07 version "0.1.0";namespace "urn:recipe:v-negation:07";
entity Person;relation edge(a: Person, b: Person);relation reach(a: Person, b: Person);rule Base strict { for a: Person; for b: Person; when edge(a, b); then reach(a, b);}rule Step strict { for a: Person; for b: Person; for c: Person; when monotone(reach(a, b)) and edge(b, c); then reach(a, c);}Frozen execution scene
Section titled “Frozen execution scene”| Facts | Question | Answer |
|---|---|---|
| edge(a,b), edge(b,c) | reach(a,c) | TRUE_ONLY |
| edge(a,b) | reach(a,c) | NEITHER |
| no base facts | reach(a,c) | NEITHER |
| replace monotone with bare | check | E4102 |
linked edges reach far end
test "linked edges reach far end" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00+05:00; knowledge_time @2026-09-13T09:00:00+05:00; timezone "Asia/Almaty"; } assert edge(entity_ref("urn:recipe:v-negation:07:a"), entity_ref("urn:recipe:v-negation:07:b")); assert edge(entity_ref("urn:recipe:v-negation:07:b"), entity_ref("urn:recipe:v-negation:07:c")); } evaluate truth(reach(entity_ref("urn:recipe:v-negation:07:a"), entity_ref("urn:recipe:v-negation:07:c"))); expect truth_status == TRUE_ONLY; expect applied(Step);}single edge reaches nowhere
test "single edge reaches nowhere" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00+05:00; knowledge_time @2026-09-13T09:00:00+05:00; timezone "Asia/Almaty"; } assert edge(entity_ref("urn:recipe:v-negation:07:a"), entity_ref("urn:recipe:v-negation:07:b")); } evaluate truth(reach(entity_ref("urn:recipe:v-negation:07:a"), entity_ref("urn:recipe:v-negation:07:c"))); expect truth_status == NEITHER;
}no edges yield nothing
test "no edges yield nothing" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00+05:00; knowledge_time @2026-09-13T09:00:00+05:00; timezone "Asia/Almaty"; }
} evaluate truth(reach(entity_ref("urn:recipe:v-negation:07:a"), entity_ref("urn:recipe:v-negation:07:c"))); expect truth_status == NEITHER;
}Counterfactual
Section titled “Counterfactual”teaches drops monotone from the recursive reading and gets E4102. The two-edge scene confirms the transitive step; the scene without a base excludes spontaneous support.
Boundary
Section titled “Boundary”Every reading inside the cycle must be monotone; empirical edge does not recurse. This form does not compute a previous round and does not allow a cycle through an aggregate. Names and computed values join only under compatible terms; a universal ban “two monotones do not join” is false.
Pitfall
Section titled “Pitfall”Read the recursive step with monotone, not supported: supported is the deliberate disputed-fact reading of Use a disputed fact deliberately, and using it for ordinary recursion needlessly lifts the whole package to a higher stratum.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.