3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 01:18:45 +00:00

add facility to solve for a linear term over API

This commit is contained in:
Nikolaj Bjorner 2024-11-30 09:34:27 -08:00
parent d2411567b5
commit 05e053247d
14 changed files with 109 additions and 6 deletions

View file

@ -7351,6 +7351,12 @@ class Solver(Z3PPObject):
"""
return _to_expr_ref(Z3_solver_congruence_next(self.ctx.ref(), self.solver, t.ast), self.ctx)
def solve_for(self, t):
t = _py2expr(t, self.ctx)
"""Retrieve a solution for t relative to linear equations maintained in the current state.
The function primarily works for SimpleSolver and when there is a solution using linear arithmetic."""
return _to_expr_ref(Z3_solver_solve_for(self.ctx.ref(), self.solver, t.ast), self.ctx)
def proof(self):
"""Return a proof for the last `check()`. Proof construction must be enabled."""
return _to_expr_ref(Z3_solver_get_proof(self.ctx.ref(), self.solver), self.ctx)