Skip to main content

solve

Function solve 

Source
pub fn solve(
    equations: &[ModpEquation],
    num_vars: usize,
    m: u64,
) -> Option<ModmOutcome>
Expand description

Decide a linear system over ℤ/m for any m ≥ 2, closing every composite modulus. By CRT, ℤ/m ≅ ∏ ℤ/pᵢ^{kᵢ}: solve each prime-power component (solve_prime_power) and recombine the residues. Consistent mod m ⟺ consistent over every prime-power factor; the first inconsistent factor is the witness (and certifies UNSAT mod m, since that factor divides m). Returns None only if m < 2, or a component is too large / overflows the integer Smith reduction.