Compare two acts on one case
Intent
Section titled “Intent”I want to compare two acts on one case.
Wrong form and why it stays silent
Section titled “Wrong form and why it stays silent”The same predicate name does not prove the same formalization depth. One .lawtest does not execute two programs at once.
fragment F in MissingCorrect form
Section titled “Correct form”language "law.core" version "0.2";package recipe.m05 version "1.0.0";namespace "urn:recipe:m-queries:05";source Act { kind policy; }edition E of Act { language ru; officiality unofficial; materialization_status ABSTRACT_ONLY; in_force [@2026-01-01, infinity); }fragment F in E { kind article; locator "article/1"; text ru unofficial "Статья 1. Заявление принимается."; }entity Person;relation registered(p: Person);relation eligible(p: Person);relation approved(p: Person);@source(F)rule Decide strict { for p: Person; when registered(p) and eligible(p); then approved(p); }Frozen execution scene
Section titled “Frozen execution scene”| Input / variant | Question | Expectation |
|---|---|---|
| 1. full input | truth(approved(entity_ref("urn:recipe:m-queries:p"))) | truth_status == TRUE_ONLY; evaluation_status == COMPUTED; |
| 2. no condition | truth(approved(entity_ref("urn:recipe:m-queries:p"))) | truth_status == NEITHER; evaluation_status == COMPUTED; |
| 3. no registration | truth(approved(entity_ref("urn:recipe:m-queries:p"))) | truth_status == NEITHER; evaluation_status == COMPUTED; |
full input establishes
test "full input establishes" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; } assert registered(entity_ref("urn:recipe:m-queries:p")); assert eligible(entity_ref("urn:recipe:m-queries:p")); } evaluate truth(approved(entity_ref("urn:recipe:m-queries:p"))); expect truth_status == TRUE_ONLY; expect evaluation_status == COMPUTED;}missing condition gives neither
test "missing condition gives 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 registered(entity_ref("urn:recipe:m-queries:p")); } evaluate truth(approved(entity_ref("urn:recipe:m-queries:p"))); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;}missing registration gives neither
test "missing registration gives 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 eligible(entity_ref("urn:recipe:m-queries:p")); } evaluate truth(approved(entity_ref("urn:recipe:m-queries:p"))); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;}The second pinned world is shown below:
language "law.core" version "0.2";package recipe.m05 version "1.0.0";namespace "urn:recipe:m-queries:05";source Act { kind policy; }edition E of Act { language ru; officiality unofficial; materialization_status ABSTRACT_ONLY; in_force [@2026-01-01, infinity); }fragment F in E { kind article; locator "article/1"; text ru unofficial "Статья 1. Заявление принимается."; }entity Person;relation registered(p: Person);relation eligible(p: Person);relation approved(p: Person);@source(F)rule Decide strict { for p: Person; when registered(p); then approved(p); }The same case and query bytes are fed separately to each program. For the three table rows world B yields TRUE_ONLY, TRUE_ONLY, NEITHER respectively. The criterion is truthStatus of one approved(p), not similarity of answer text. Ordinary law_measure confirms for both worlds one article at depth EXECUTABLE. Different programHash with the same caseHash is expected.
Check of result fields and extra inputs:
>>> import runpy>>> checks = runpy.run_path("docs/recipes/m-queries/resources/check.py")>>> checks["worlds"](https://github.com/arxohq/law/blob/master/docs/recipes/m-queries/5)TrueCounterfactual
Section titled “Counterfactual”The sidecar mutation reproduces LDC-E5102. Counterfactual table variants are executed separately; input errors are not passed off as NEITHER.
Boundary
Section titled “Boundary”Comparison is by an explicitly same observed quantity approved(p), not by equality of hashes of different programs. The synthetic second act uses the same interface; these are two separate pinned worlds, not a merge of them.
Pitfall
Section titled “Pitfall”SOURCE_ONLY is not comparable with EXECUTABLE as the same formalization — see Measure formalization depth.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.