Power and valid exercise
Intention
Section titled “Intention”I want to create an effect only when a valid power is exercised.
Incorrect form and why it stays silent
Section titled “Incorrect form and why it stays silent”effect approve(valid(p));A homemade effect name is not a materialization operation. This example needs create; the mere presence of a power does not create the effect.
Correct form
Section titled “Correct form”language "law.core" version "0.2";package recipes.a.r06 version "0.1.0";namespace "urn:recipe:a-positions:06";
entity Person;relation registered(p: Person);relation done(p: Person);relation sign(p: Person);relation competent(p: Person);relation valid(p: Person);rule Grant strict { for p: Person; when registered(p); then power Permit { holder p; exercise sign(p); valid_when competent(p); effect create(valid(p)); };}Frozen execution scene
Section titled “Frozen execution scene”| Facts and snapshot | Question | Answer |
|---|---|---|
| power without exercise; 2026-09-05 | truth(valid(entity_ref("urn:recipe:a-positions:06:p"))) | truth_status == NEITHER; / COMPUTED |
| valid exercise; 2026-09-05 | truth(valid(entity_ref("urn:recipe:a-positions:06:p"))) | truth_status == TRUE_ONLY; / COMPUTED |
| competence not presented; 2026-09-05 | truth(valid(entity_ref("urn:recipe:a-positions:06:p"))) | truth_status == NEITHER; / COMPUTED |
power without exercise stays unknown
test "power without exercise stays unknown" { given { context { legal_time @2026-09-05; decision_time @2026-09-05T09:00:00+05:00; knowledge_time @2026-09-30T09:00:00+05:00; timezone "Asia/Almaty"; } assert registered(entity_ref("urn:recipe:a-positions:06:p")); assert competent(entity_ref("urn:recipe:a-positions:06:p")); } evaluate truth(valid(entity_ref("urn:recipe:a-positions:06:p"))); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;
}valid exercise establishes effect
test "valid exercise establishes effect" { given { context { legal_time @2026-09-05; decision_time @2026-09-05T09:00:00+05:00; knowledge_time @2026-09-30T09:00:00+05:00; timezone "Asia/Almaty"; } assert registered(entity_ref("urn:recipe:a-positions:06:p")); assert competent(entity_ref("urn:recipe:a-positions:06:p")); assert sign(entity_ref("urn:recipe:a-positions:06:p")); } evaluate truth(valid(entity_ref("urn:recipe:a-positions:06:p"))); expect truth_status == TRUE_ONLY; expect evaluation_status == COMPUTED;
}missing competence blocks exercise
test "missing competence blocks exercise" { given { context { legal_time @2026-09-05; decision_time @2026-09-05T09:00:00+05:00; knowledge_time @2026-09-30T09:00:00+05:00; timezone "Asia/Almaty"; } assert registered(entity_ref("urn:recipe:a-positions:06:p")); assert sign(entity_ref("urn:recipe:a-positions:06:p")); } evaluate truth(valid(entity_ref("urn:recipe:a-positions:06:p"))); expect truth_status == NEITHER; expect evaluation_status == COMPUTED; expect issue(POWER_INVALID_EXERCISE);}effect create(valid(p)) is replaced with effect approve(valid(p)): check and lower are green, the effect is not created; the answer is NEITHER.
renamed effect creates nothing
test "renamed effect creates nothing" { given { context { legal_time @2026-09-05; decision_time @2026-09-05T09:00:00+05:00; knowledge_time @2026-09-30T09:00:00+05:00; timezone "Asia/Almaty"; } assert registered(entity_ref("urn:recipe:a-positions:06:p")); assert competent(entity_ref("urn:recipe:a-positions:06:p")); assert sign(entity_ref("urn:recipe:a-positions:06:p")); } evaluate truth(valid(entity_ref("urn:recipe:a-positions:06:p"))); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;
}>>> import runpy>>> check = runpy.run_path("docs/recipes/a-positions/resources/check.py")>>> check["check_variant"](https://github.com/arxohq/law/blob/master/docs/recipes/a-positions/6)'А6: контрфактуал подтверждён; lawc = lawref'Counterfactual
Section titled “Counterfactual”Mutation: valid_when competent(p); → “; rejection LDC-E1305. Additional counterfactuals are shown as separate scenes.
Boundary
Section titled “Boundary”Exercise here is represented by an established relation of accepted exercise. For presenting events with time, see Present an event with a time. terminate/modify and unsupported operations are not substituted with create.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.