Expand description
The decision core for linear integer arithmetic: Fourier-Motzkin elimination
that tracks the non-negative combination it eliminates with, so an
unsatisfiable system yields its Farkas certificate — the multipliers λᵢ ≥ 0
on the original constraints such that Σ λᵢ·constraintᵢ is a positive constant
≤ 0 (a contradiction). The proof engine reconstructs a kernel proof from those
multipliers via le_mul_nonneg/le_add_mono + the Bool no-confusion
discriminator. Pure and self-contained — no kernel, no certificates here.
Structs§
- LinExpr
- A linear expression
Σ cⱼ·xⱼ + constantover the integers (zero coefficients pruned, so equality is canonical).
Functions§
- combine
Σ multipliers[i]·constraints[i]. For a valid Farkas certificate this is a bare positive constant (the variables cancel) — that constant is thedin the reconstructed contradiction0 ≤ -d.- find_
farkas - Given constraints
cᵢ ≤ 0, find a non-negative integer combinationΣ λᵢ·cᵢ = (positive constant) ≤ 0— a Farkas refutation. Returns the multipliersλᵢ, orNoneif the system is satisfiable over ℚ (so no rational Farkas certificate exists). - parse_
lin - Parse a
ProofTerminto a linear expression, orNoneif it is non-linear (e.g.mulof two non-constants). Numeric constants are literals; other names are variables;add/sub/mulbuild the form.