Skip to content
docs
Arxo ↗

Rate from a table

For LLMs7 sections

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
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.

Arxo Law
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;
}
}
Facts and choiceQuestionAnswer
1. base 999Rate(999)0.1 / COMPUTED
2. base 1000Rate(1000)0.15 / COMPUTED
3. base 1999Rate(1999)0.15 / COMPUTED
4. base 2000Rate(2000)0.2 / COMPUTED
below first threshold
Arxo Law
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
Arxo Law
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
Arxo Law
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
Arxo Law
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;
}

Mutation: when x < 1000 → when x <= 1000; expected LDC-E8304. Additional counterfactuals are shown as separate table rows.

The example sets a rate, not a progressive sum; the latter is Progressive scale by brackets.

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.