3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00

adding lookahead and lemmas

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-06-01 14:49:54 -07:00
parent 7d245be4e1
commit 4e65c13726
13 changed files with 203 additions and 1 deletions

View file

@ -6216,6 +6216,21 @@ class Solver(Z3PPObject):
consequences = [ consequences[i] for i in range(sz) ]
return CheckSatResult(r), consequences
def lemmas(self):
"""Extract auxiliary lemmas produced by solver"""
return AstVector(Z3_solver_get_lemmas(self.ctx.ref(), self.solver), self.ctx)
def lookahead(self, candidates = None):
"""Get lookahead literal"""
if candidates is None:
candidates = AstVector(None, self.ctx)
elif not isinstance(candidates, AstVector):
_cs = AstVector(None, self.ctx)
for c in candidates:
_asms.push(c)
candidates = _cs
return _to_expr_ref(Z3_solver_lookahead(self.ctx.ref(), self.solver, candidates), 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)