mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +00:00
include special functionality in parsers for solvers and opt for additional file formats
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
187998ae4d
commit
5ee30a3cd9
12 changed files with 324 additions and 303 deletions
|
@ -6324,6 +6324,20 @@ class Solver(Z3PPObject):
|
|||
sz = len(consequences)
|
||||
consequences = [ consequences[i] for i in range(sz) ]
|
||||
return CheckSatResult(r), consequences
|
||||
|
||||
def from_file(self, filename):
|
||||
"""Parse assertions from a file"""
|
||||
try:
|
||||
Z3_solver_from_file(self.ctx.ref(), self.solver, filename)
|
||||
except Z3Exception as e:
|
||||
_handle_parse_error(e, self.ctx)
|
||||
|
||||
def from_string(self, s):
|
||||
"""Parse assertions from a string"""
|
||||
try:
|
||||
Z3_solver_from_string(self.ctx.ref(), self.solver, s)
|
||||
except Z3Exception as e:
|
||||
_handle_parse_error(e, self.ctx)
|
||||
|
||||
def proof(self):
|
||||
"""Return a proof for the last `check()`. Proof construction must be enabled."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue