3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

expose import model converter over Python, document it, add partial order axioms for lex, disable linear order axioms, prepare ground for re-adding clauses from reconstruction stack

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-07-17 12:45:30 -04:00
parent 7ed5ca05e3
commit 41ca956012
11 changed files with 202 additions and 81 deletions

View file

@ -6646,6 +6646,10 @@ class Solver(Z3PPObject):
except Z3Exception:
raise Z3Exception("model is not available")
def import_model_converter(self, other):
"""Import model converter from other into the current solver"""
Z3_solver_import_model_converter(self.ctx.ref(), other.solver, self.solver)
def unsat_core(self):
"""Return a subset (as an AST vector) of the assumptions provided to the last check().
@ -8310,11 +8314,17 @@ def AtLeast(*args):
_args, sz = _to_ast_array(args1)
return BoolRef(Z3_mk_atleast(ctx.ref(), sz, _args, k), ctx)
def _reorder_pb_arg(arg):
a, b = arg
if not _is_int(b) and _is_int(a):
return b, a
return arg
def _pb_args_coeffs(args, default_ctx = None):
args = _get_args_ast_list(args)
if len(args) == 0:
return _get_ctx(default_ctx), 0, (Ast * 0)(), (ctypes.c_int * 0)()
args = [_reorder_pb_arg(arg) for arg in args]
args, coeffs = zip(*args)
if z3_debug():
_z3_assert(len(args) > 0, "Non empty list of arguments expected")

View file

@ -6213,6 +6213,14 @@ extern "C" {
/**
\brief Ad-hoc method for importing model conversion from solver.
This method is used for scenarios where \c src has been used to solve a set
of formulas and was interrupted. The \c dst solver may be a strengthening of \c src
obtained from cubing (assigning a subset of literals or adding constraints over the
assertions available in \c src). If \c dst ends up being satisfiable, the model for \c dst
may not correspond to a model of the original formula due to inprocessing in \c src.
This method is used to take the side-effect of inprocessing into account when returning
a model for \c dst.
def_API('Z3_solver_import_model_converter', VOID, (_in(CONTEXT), _in(SOLVER), _in(SOLVER)))
*/