Fold bridges into one deadline rule
Intention
Section titled “Intention”I want to apply a single term to two kinds of notice, not including the event day.
Incorrect form and why it stays silent
Section titled “Incorrect form and why it stays silent”An inclusive guard treats the event day as admissible:
days_between(add_business_days(sent_on, 3 business_day), visit_on) >= 0Correct form
Section titled “Correct form”language "law.core" version "0.2";package recipes.e.r11 version "0.1.0";namespace "urn:recipe:e-time:11";
entity Person;relation registered(p: Person);source SyntheticCalendar { kind standard; jurisdiction "none"; number "E-CALENDAR"; }calendar Calendar { timezone "Asia/Almaty"; timezone_db "iana-tzdb@2026a"; period [@2024-01-01, @2028-01-01); source SyntheticCalendar; resource "resources/calendar-2024-2027.json"; format "law.calendar/0.1"; content_hash "sha256:dfd0181e1347cc2fd48b5fd81d27f3551cabae10eaefbf8b4dffb70bcbb3cd12";}deadline policy Days { start_count next_day; include_end true; roll next_working_day;}relation sent_a(p: Person, on: Date);relation sent_b(p: Person, on: Date);relation notice(p: Person, on: Date);relation visit(p: Person, on: Date);relation timely(p: Person);rule BridgeA strict { for p: Person; for on: Date; when sent_a(p, on); then notice(p, on); }rule BridgeB strict { for p: Person; for on: Date; when sent_b(p, on); then notice(p, on); }rule CommonTerm strict { for p: Person; for sent_on: Date; for visit_on: Date; when notice(p, sent_on) and visit(p, visit_on) and days_between(add_business_days(sent_on, 3 business_day), visit_on) > 0; then timely(p);}Frozen execution scene
Section titled “Frozen execution scene”| Facts / cut | Question | Answer |
|---|---|---|
| A: sent 06.03, visit 12.03 | timely | NEITHER |
| A: sent 06.03, visit 13.03 | timely | TRUE_ONLY |
| B: sent 06.03, visit 13.03 | timely | TRUE_ONLY |
| without bridge B | timely | NEITHER |
| cutoff coincided with the event | days_between | 0 |
| same cutoff, incorrect >= | comparison | true — event day admitted |
event day excluded from term
test "event day excluded from term" { given { context { legal_time @2026-03-10; decision_time @2027-12-31T09:00:00+05:00; knowledge_time @2027-12-31T09:00:00+05:00; timezone "Asia/Almaty"; deadline_policy Days; } assert sent_a(entity_ref("urn:recipe:e-time:11:a"), @2026-03-06); assert visit(entity_ref("urn:recipe:e-time:11:a"), @2026-03-12); } evaluate truth(timely(entity_ref("urn:recipe:e-time:11:a"))); expect truth_status == NEITHER;}shared term serves first bridge
test "shared term serves first bridge" { given { context { legal_time @2026-03-10; decision_time @2027-12-31T09:00:00+05:00; knowledge_time @2027-12-31T09:00:00+05:00; timezone "Asia/Almaty"; deadline_policy Days; } assert sent_a(entity_ref("urn:recipe:e-time:11:a"), @2026-03-06); assert visit(entity_ref("urn:recipe:e-time:11:a"), @2026-03-13); } evaluate truth(timely(entity_ref("urn:recipe:e-time:11:a"))); expect truth_status == TRUE_ONLY;}shared term serves second bridge
test "shared term serves second bridge" { given { context { legal_time @2026-03-10; decision_time @2027-12-31T09:00:00+05:00; knowledge_time @2027-12-31T09:00:00+05:00; timezone "Asia/Almaty"; deadline_policy Days; } assert sent_b(entity_ref("urn:recipe:e-time:11:a"), @2026-03-06); assert visit(entity_ref("urn:recipe:e-time:11:a"), @2026-03-13); } evaluate truth(timely(entity_ref("urn:recipe:e-time:11:a"))); expect truth_status == TRUE_ONLY;}missing bridge stays silent
test "missing bridge stays silent" { given { context { legal_time @2026-03-10; decision_time @2027-12-31T09:00:00+05:00; knowledge_time @2027-12-31T09:00:00+05:00; timezone "Asia/Almaty"; deadline_policy Days; } assert sent_b(entity_ref("urn:recipe:e-time:11:a"), @2026-03-06); assert visit(entity_ref("urn:recipe:e-time:11:a"), @2026-03-13); } evaluate truth(timely(entity_ref("urn:recipe:e-time:11:a"))); expect truth_status == NEITHER;}zero difference on boundary
test "zero difference on boundary" { given { context { legal_time @2026-03-10; decision_time @2027-12-31T09:00:00+05:00; knowledge_time @2027-12-31T09:00:00+05:00; timezone "Asia/Almaty"; deadline_policy Days; }
} evaluate days_between(add_business_days(@2026-03-06, 3 business_day), @2026-03-12); expect value == 0;}The calendar is synthetic: Mon–Fri, 9 March 2026 is a conventional non-working day; this is not an official calendar.
inclusive variant admits event day
test "inclusive variant admits event day" { given { context { legal_time @2026-03-10; decision_time @2027-12-31T09:00:00+05:00; knowledge_time @2027-12-31T09:00:00+05:00; timezone "Asia/Almaty"; deadline_policy Days; }
} evaluate if days_between(add_business_days(@2026-03-06, 3 business_day), @2026-03-12) >= 0 then true else false; expect value == true;}Counterfactual
Section titled “Counterfactual”The two filing forms meet in notice. runs.without drops BridgeB and reveals a missed bridge. teaches replaces the integer threshold with a quantity and requires E2108; a separate comparison query shows that at the cutoff the difference is zero.
Boundary
Section titled “Boundary”Strict > is chosen for the wording “three full business days before, the event day not included”. Another wording may include the cutoff: see Check a notice before an event. For a real shared code the rule lives with the owner and is imported; this standalone page does not import the corpus.
Pitfall
Section titled “Pitfall”The scene excludes the event day and shows the difference between >= and >; the error cannot be fixed by a hidden subtraction of a day.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.