Take a calculation from another act
Intent
Section titled “Intent”I want to use a public result of a neighbouring package.
Wrong form and why it stays silent
Section titled “Wrong form and why it stays silent”If pub is removed from the owner’s amount, that package still compiles, but the consumer’s lower rejects the reference: LDC-E1105. With the interface alone, without the owner’s rules in the world, the result remains NEITHER. The adapter checks both cases. An extra static mutation below reminds that an import alias is reserved.
import recipe.dependency version "1.0.0" as dep;pub entity Person;Correct form
Section titled “Correct form”language "law.core" version "0.2";package recipe.i10 version "1.0.0";namespace "urn:recipe:i-sources:10";pub entity Person;pub relation units(p: Person, count: Integer);pub relation amount(p: Person, value: Integer);pub rule Calculate strict { for p: Person; for count: Integer; when units(p, count); then amount(p, count * 7); }Frozen execution scene
Section titled “Frozen execution scene”Below is a minimal reproducible scene.
| World and facts | Answer amount/total |
|---|---|
| interface, units(p, 3) | NEITHER |
| merged world, units(p, 3) | TRUE_ONLY, 21 |
| merged world without units(p, 3) | NEITHER |
| owner removed pub from amount | E1105 on consumer lower |
>>> import runpy>>> checks = runpy.run_path("docs/recipes/i-sources/resources/check.py")>>> checks["imports"](https://github.com/arxohq/law/blob/master/docs/recipes/i-sources/10)TrueConsumer (a separate package; the adapter compiles it with an export context):
language "law.core" version "0.2";package recipe.consumer10 version "1.0.0";namespace "urn:recipe:i-sources:10:consumer";import recipe.i10 version "1.0.0";relation total(p: recipe.i10::Person, value: Integer);rule ReadAmount strict { for p: recipe.i10::Person; for v: Integer; when recipe.i10::amount(p, v); then total(p, v); }Interface world:
interface without rules answers neither
language "law.core" version "0.2";package recipe.consumer10 version "1.0.0";namespace "urn:recipe:i-sources:10:consumer";
test "interface without rules answers neither" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; } assert recipe.i10::units(entity_ref("urn:recipe:i-sources:person"), 3); } evaluate truth(total(entity_ref("urn:recipe:i-sources:person"), 21)); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;}World world:
merged world computes twenty-one
language "law.core" version "0.2";package recipe.consumer10 version "1.0.0";namespace "urn:recipe:i-sources:10:consumer";
test "merged world computes twenty-one" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; } assert recipe.i10::units(entity_ref("urn:recipe:i-sources:person"), 3); } evaluate truth(total(entity_ref("urn:recipe:i-sources:person"), 21)); expect truth_status == TRUE_ONLY; expect evaluation_status == COMPUTED;}
test "merged world without fact answers neither" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; }
} evaluate truth(total(entity_ref("urn:recipe:i-sources:person"), 21)); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;}Counterfactual
Section titled “Counterfactual”The teaches mutation reproduces LDC-E0206. Additionally the adapter removes pub → E1105, changes the bytes of the pinned owner → E1104, and drops the resolve context → E1104. These are three different refusals, not one “import does not work”.
Boundary
Section titled “Boundary”The page shows the owner of the exports. The consumer and its context are synthetic resources of this same book. An import supplies an interface; participation of rules requires presenting a world.
Here a minimal checkable witness is left.
Pitfall
Section titled “Pitfall”An empty dependency world stays silent; pub is added at the owner.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.