A Python checker to automatically validate a list of polynomial inequalities by detecting contradictions using symbolic and SMT-based methods.
This project takes a list of inequalities (as strings) and checks if they are consistent (i.e., whether there exists an assignment of real values to variables that makes them all true).
It uses:
- Symbolic simplification (
Sympy) - SMT solvers (
Z3)
premises = [
"(xz−2x−5z) > 0",
"(4x+y+5) ≥ 0",
"(3x(yz+5y+1)) ≥ 0",
"(1) = 0",
"(yz−4y+5z+3) > 0"
]Algorithm: check_premises
Input: A list of inequalities (string),
Initialize Z3 Solver
Catch:
Try:
Catch:
Report error in reading inequality Return
If
Return "The premises has no contradictions"
Else:
Return "The premises is unsatisfiable and has contradictions"
Proof: Correctness of Premise Checker Function
Definitions
Definition 1: Let
By the definition of the SMT solver, if Z3 returns satisfiable, then there exists a model
Case 2: Z3(
By the definition of the SMT solver, if Z3 returns unsatisfiable, then there is no model
Conclusion:
The proof demonstrates that the check_premises function correctly determines the satisfiability of a set of inequalities, assuming the correctness of the Z3 SMT solver and the meaning-preservation of the translation function