test(core): the payroll plan harness carries one employee
The two-employee payroll_plan_balances timed out in CBMC: over 80 minutes at full CPU, killed with no result (sixteen symbolic figures into eight totals and check_lines). The earlier note's 297.6s figure came from a misattributed background result and is withdrawn here; the harness as committed had never verified. One employee reaches every plan line, both FICA shares on both sides, net_pay and check_lines, and verifies in 62.0s (65.6s wall). Lean's payroll_plan_balances carries the plan at its totals for any number of employees, since a run's totals are sums of the same eight figures. The bound and why are written in the harness and the note. Co-Authored-By: Muse Wonder 1.0
This commit is contained in:
1 parent
fbe7eb7125
commit
2295d15be8
3 files changed
+14
-11
No files matched your search
@@ -6,7 +6,7 @@
|
||||
//!
|
||||
//! A payroll line carries five employee deductions (federal, state,
|
||||
//! Social Security, Medicare, other), so the deduction arrays are fixed
|
||||
//! at five. The plan harness carries two employees and the plan's eight
|
||||
//! at five. The plan harness carries one employee and the plan's eight
|
||||
//! totals (gross, employer FICA, the five payables, net), each a kernel
|
||||
//! total of the two lines, in a fixed array of eight `(Side, amount)`
|
||||
//! lines. Amounts run to a few thousand units: the law is about the
|
||||
@@ -116,13 +116,19 @@ fn net_pay_nonnegative_when() {
|
||||
kani::cover!(deducted > 0 && net > 0, "a partial withholding");
|
||||
}
|
||||
|
||||
/// The payroll plan balances through `check_lines`: two employees, the
|
||||
/// The payroll plan balances through `check_lines`: one employee, the
|
||||
/// eight totals `payroll_entry_plan` posts (Dr gross, Dr employer FICA,
|
||||
/// Cr federal, state, Social Security, Medicare and other payables, Cr
|
||||
/// cash net), every total positive, debits equal to credits exactly.
|
||||
/// Two employees timed out in CBMC (over 80 minutes, 2026-11-09:
|
||||
/// sixteen symbolic figures into eight totals and `check_lines`); one
|
||||
/// employee reaches every line, both FICA shares on both sides, and
|
||||
/// the balance, and Lean's `payroll_plan_balances` carries the plan at
|
||||
/// its totals for any number of employees (a run's totals are sums of
|
||||
/// the same eight figures).
|
||||
#[kani::proof]
|
||||
fn payroll_plan_balances() {
|
||||
let employees = [any_employee(), any_employee()];
|
||||
let employees = [any_employee()];
|
||||
let gross = total(employees.iter().map(|e| e.gross)).expect("in range");
|
||||
let employer = total(
|
||||
employees
|
||||
@@ -164,9 +170,6 @@ fn payroll_plan_balances() {
|
||||
check_lines(&plan).is_ok(),
|
||||
"the payroll plan is an acceptable entry"
|
||||
);
|
||||
kani::cover!(
|
||||
employees[0].gross != employees[1].gross,
|
||||
"two employees differ"
|
||||
);
|
||||
kani::cover!(net > gross, "net over two employees exceeds one gross");
|
||||
kani::cover!(net < gross, "withholdings leave a smaller net");
|
||||
kani::cover!(employer > 0, "the employer share is posted");
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
//! U7 bridge properties: payroll arithmetic (kernel sweep).
|
||||
//!
|
||||
//! `proofs/payroll.rs` proves `kernel::net_pay` on `i64` (five
|
||||
//! deductions, a two-employee plan through `check_lines`); the engine
|
||||
//! deductions, a one-employee plan through `check_lines`); the engine
|
||||
//! runs the same code on `Decimal`. These properties check that the two
|
||||
//! instantiations agree, that `Decimal` agrees with an independent exact
|
||||
//! `i128` reference (mantissas over a common power of ten, sharing no
|
||||
|
||||
Reference in new issue
Block a user