pub fn fourier_motzkin_unsat(constraints: &[Constraint]) -> boolExpand description
Check if a constraint set is unsatisfiable using Fourier-Motzkin elimination.
This is the core decision procedure. It eliminates variables one by one until only constant constraints remain, then checks for contradictions.
§Algorithm
For each variable x in the system:
- Partition constraints into lower bounds on x, upper bounds on x, and independent
- For each pair (lower, upper), derive a new constraint without x
- Check for immediate contradictions (e.g.,
5 <= 0)
§Returns
trueif the constraints are unsatisfiable (contradiction found)falseif the constraints may be satisfiable
§Usage for Validity
To prove a goal G is valid, we check if NOT(G) is unsatisfiable.
If fourier_motzkin_unsat(negation_constraints) returns true, the goal is valid.