From 176b59cc4f309bb8ed11deee194e6a8b3ef37c4f Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 8 Nov 2026 22:35:10 -0700 Subject: [PATCH] fix(proofs): part_weight is a lemma for laws 26-28 Law 26 is that the parts of a proration sum to its total, which prorate_parts_sum_to_total proves. part_weight_is_days_of_the_month proves the weight formula (days x monthly rate), which is law 27's statement. Its row is numbered 27 now, in both tables, with a note that it is a lemma for laws 26-28 rather than a restatement of law 26. Co-Authored-By: DeepSeek V4.1 Flash --- docs/proofs/entries.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/proofs/entries.md b/docs/proofs/entries.md index cb5c5285..86efac50 100644 --- a/docs/proofs/entries.md +++ b/docs/proofs/entries.md @@ -16,7 +16,13 @@ the exception list before. | Harness | Law | Bounds | |---|---|---| | `direction_of_is_the_sign` | 23 | any `i64` amount; all three signs covered | -| `part_weight_is_days_of_the_month` | 26 | `days` and `month_days` 0..=40; valid, partial, whole and invalid parts covered | +| `part_weight_is_days_of_the_month` | 27 | `days` and `month_days` 0..=40; valid, partial, whole and invalid parts covered | + +`part_weight_is_days_of_the_month` proves the weight formula a proration +charge is computed from, which is law 27's statement (each part but the +last is its days times the monthly rate); it is a lemma for laws 26-28, +not a restatement of law 26 (that the parts sum to the total, which is +`prorate_parts_sum_to_total` below). The bookspec law each harness proves (machine-readable for the traceability gate, `crates/ledger-core/tests/bookspec/traceability.rs`): @@ -24,7 +30,7 @@ traceability gate, `crates/ledger-core/tests/bookspec/traceability.rs`): | Harness | Law | |---|---| | `direction_of_is_the_sign` | 23 | -| `part_weight_is_days_of_the_month` | 26 | +| `part_weight_is_days_of_the_month` | 27 | Times: measured alone with `cargo kani -p ledger-core --exact --harness proofs::` on 2026-11-08: @@ -45,4 +51,5 @@ verification, 3 covers, build included). Why these laws: `Direction::of` is the sign classification the party direction law (23) is stated over, and `part_weight` is the weight the -proration charges of laws 26-28 are computed from. +proration charges of laws 26-28 are computed from, its harness numbered +for the law it restates most closely (27).