Expand description
Algebraic solver and bounded model checker for Trident constraint systems.
Takes the ConstraintSystem from sym.rs and checks it using:
-
Schwartz-Zippel testing: Evaluate polynomial constraints at random field points. If a polynomial identity holds at k random points over F_p, the probability it’s false is ≤ d/p where d is the degree. For our degrees (< 2^16) and Goldilocks p (≈ 2^64), this is negligibly small.
-
Bounded model checking: Enumerate concrete variable assignments and check all constraints. For programs with few free variables (< 20), we can check a large sample. For programs with many variables, we use random sampling with the Schwartz-Zippel guarantee.
-
Counterexample generation: When a constraint fails, report the concrete variable assignment that violates it.
-
Redundant assertion detection: Identify constraints that hold for all tested inputs (candidate tautologies) — these can be eliminated to reduce proving cost.
Structs§
- BmcConfig
- Configuration for bounded model checking.
- Counterexample
- A concrete counterexample showing a constraint violation.
- Solver
Config - Configuration for the solver.
- Solver
Result - Result of solving/checking a constraint system.
- Verification
Report - Full verification result combining static analysis, random testing, and BMC.
Enums§
Functions§
- bounded_
check - Run bounded model checking: test constraints against systematic value choices.
- format_
constraint - Format a constraint for human-readable display.
- format_
sym_ value - Format a symbolic value for display (abbreviated).
- solve
- Solve a constraint system using random evaluation (Schwartz-Zippel) and bounded model checking.
- verify
- Run full verification: static + random + BMC.