mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
delay internalize (#4714)
* adding array solver Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * use default in model construction Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * debug delay internalization Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * bv Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * get rid of implied values and bounds Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * redo egraph * remove out Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * remove files Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
25724401cf
commit
367e5fdd52
60 changed files with 1343 additions and 924 deletions
|
@ -559,39 +559,6 @@ extern "C" {
|
|||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_ast Z3_API Z3_solver_get_implied_value(Z3_context c, Z3_solver s, Z3_ast e) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_solver_get_implied_value(c, s, e);
|
||||
RESET_ERROR_CODE();
|
||||
init_solver(c, s);
|
||||
expr_ref v = to_solver_ref(s)->get_implied_value(to_expr(e));
|
||||
mk_c(c)->save_ast_trail(v);
|
||||
RETURN_Z3(of_ast(v));
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_ast Z3_API Z3_solver_get_implied_lower(Z3_context c, Z3_solver s, Z3_ast e) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_solver_get_implied_lower(c, s, e);
|
||||
RESET_ERROR_CODE();
|
||||
init_solver(c, s);
|
||||
expr_ref v = to_solver_ref(s)->get_implied_lower_bound(to_expr(e));
|
||||
mk_c(c)->save_ast_trail(v);
|
||||
RETURN_Z3(of_ast(v));
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_ast Z3_API Z3_solver_get_implied_upper(Z3_context c, Z3_solver s, Z3_ast e) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_solver_get_implied_upper(c, s, e);
|
||||
RESET_ERROR_CODE();
|
||||
init_solver(c, s);
|
||||
expr_ref v = to_solver_ref(s)->get_implied_upper_bound(to_expr(e));
|
||||
mk_c(c)->save_ast_trail(v);
|
||||
RETURN_Z3(of_ast(v));
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
static Z3_lbool _solver_check(Z3_context c, Z3_solver s, unsigned num_assumptions, Z3_ast const assumptions[]) {
|
||||
for (unsigned i = 0; i < num_assumptions; i++) {
|
||||
if (!is_expr(to_ast(assumptions[i]))) {
|
||||
|
|
|
@ -2402,16 +2402,6 @@ namespace z3 {
|
|||
void from_file(char const* file) { Z3_solver_from_file(ctx(), m_solver, file); ctx().check_parser_error(); }
|
||||
void from_string(char const* s) { Z3_solver_from_string(ctx(), m_solver, s); ctx().check_parser_error(); }
|
||||
|
||||
expr lower(expr const& e) {
|
||||
Z3_ast r = Z3_solver_get_implied_lower(ctx(), m_solver, e); check_error(); return expr(ctx(), r);
|
||||
}
|
||||
expr upper(expr const& e) {
|
||||
Z3_ast r = Z3_solver_get_implied_upper(ctx(), m_solver, e); check_error(); return expr(ctx(), r);
|
||||
}
|
||||
expr value(expr const& e) {
|
||||
Z3_ast r = Z3_solver_get_implied_value(ctx(), m_solver, e); check_error(); return expr(ctx(), r);
|
||||
}
|
||||
|
||||
check_result check() { Z3_lbool r = Z3_solver_check(ctx(), m_solver); check_error(); return to_check_result(r); }
|
||||
check_result check(unsigned n, expr * const assumptions) {
|
||||
array<Z3_ast> _assumptions(n);
|
||||
|
|
|
@ -6857,21 +6857,6 @@ class Solver(Z3PPObject):
|
|||
"""
|
||||
return AstVector(Z3_solver_get_trail(self.ctx.ref(), self.solver), self.ctx)
|
||||
|
||||
def value(self, e):
|
||||
"""Return value of term in solver, if any is given.
|
||||
"""
|
||||
return _to_expr_ref(Z3_solver_get_implied_value(self.ctx.ref(), self.solver, e.as_ast()), self.ctx)
|
||||
|
||||
def lower(self, e):
|
||||
"""Return lower bound known to solver based on the last call.
|
||||
"""
|
||||
return _to_expr_ref(Z3_solver_get_implied_lower(self.ctx.ref(), self.solver, e.as_ast()), self.ctx)
|
||||
|
||||
def upper(self, e):
|
||||
"""Return upper bound known to solver based on the last call.
|
||||
"""
|
||||
return _to_expr_ref(Z3_solver_get_implied_upper(self.ctx.ref(), self.solver, e.as_ast()), self.ctx)
|
||||
|
||||
def statistics(self):
|
||||
"""Return statistics for the last `check()`.
|
||||
|
||||
|
|
|
@ -6499,35 +6499,6 @@ extern "C" {
|
|||
*/
|
||||
void Z3_API Z3_solver_get_levels(Z3_context c, Z3_solver s, Z3_ast_vector literals, unsigned sz, unsigned levels[]);
|
||||
|
||||
/**
|
||||
\brief retrieve implied value for expression, if any is implied by solver at search level.
|
||||
The method works for expressions that are known to the solver state, such as Boolean and
|
||||
arithmetical variables.
|
||||
|
||||
def_API('Z3_solver_get_implied_value', AST, (_in(CONTEXT), _in(SOLVER), _in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_solver_get_implied_value(Z3_context c, Z3_solver s, Z3_ast e);
|
||||
|
||||
/**
|
||||
\brief retrieve implied lower bound value for arithmetic expression.
|
||||
If a lower bound is implied at search level, the arithmetic expression returned
|
||||
is a constant representing the bound.
|
||||
|
||||
def_API('Z3_solver_get_implied_lower', AST, (_in(CONTEXT), _in(SOLVER), _in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_solver_get_implied_lower(Z3_context c, Z3_solver s, Z3_ast e);
|
||||
|
||||
/**
|
||||
\brief retrieve implied upper bound value for arithmetic expression.
|
||||
If an upper bound is implied at search level, the arithmetic expression returned
|
||||
is a constant representing the bound.
|
||||
|
||||
def_API('Z3_solver_get_implied_upper', AST, (_in(CONTEXT), _in(SOLVER), _in(AST)))
|
||||
*/
|
||||
|
||||
Z3_ast Z3_API Z3_solver_get_implied_upper(Z3_context c, Z3_solver s, Z3_ast e);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief register a user-properator with the solver.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue