Rate from a table
For LLMs7 sections
Intention
Section titled “Intention”I want to pick exactly one rate over non-overlapping ranges.
Putting the 1000 boundary in both rows yields LDC-E8304: the table cannot prove the rows do not overlap.
Incorrect form and why it stays silent
Section titled “Incorrect form and why it stays silent”when x <= 1000 => 10 percent;when x >= 1000 and x < 2000 => 15 percent;Both rows accept 1000: unique must reject the overlap rather than take the first row.
Correct form
Section titled “Correct form”language "law.core" version "0.2";package recipes.l.r01 version "0.1.0";namespace "urn:recipe:l-calc:01";
decision Rate(x: Integer) -> Decimal { table hit unique { when x < 1000 => 10 percent; when x >= 1000 and x < 2000 => 15 percent; otherwise => 20 percent; }}Frozen execution scene
Section titled “Frozen execution scene”| Facts and choice | Question | Answer |
|---|---|---|
| 1. base 999 | Rate(999) | 0.1 / COMPUTED |
| 2. base 1000 | Rate(1000) | 0.15 / COMPUTED |
| 3. base 1999 | Rate(1999) | 0.15 / COMPUTED |
| 4. base 2000 | Rate(2000) | 0.2 / COMPUTED |
below first threshold
test "below first threshold" { 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 Rate(999); expect value == 0.1; expect evaluation_status == COMPUTED;
}first threshold rate
test "first threshold rate" { 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 Rate(1000); expect value == 0.15; expect evaluation_status == COMPUTED;
}inside middle band
test "inside middle band" { 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 Rate(1999); expect value == 0.15; expect evaluation_status == COMPUTED;
}second threshold rate
test "second threshold rate" { 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 Rate(2000); expect value == 0.2; expect evaluation_status == COMPUTED;
}Counterfactual
Section titled “Counterfactual”Mutation: when x < 1000 → when x <= 1000; expected LDC-E8304. Additional counterfactuals are shown as separate table rows.
Boundary
Section titled “Boundary”The example sets a rate, not a progressive sum; the latter is Progressive scale by brackets.
Pitfall
Section titled “Pitfall”With hit unique, an overlap is rejected rather than resolved by taking the first row.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.