mirror of
https://github.com/Z3Prover/z3
synced 2025-06-18 03:46:17 +00:00
Merge branch 'unstable' of https://github.com/Z3Prover/z3 into unstable
This commit is contained in:
commit
d94e12104d
9 changed files with 54 additions and 4 deletions
|
@ -33,7 +33,7 @@ context_params::context_params() {
|
||||||
m_trace = false;
|
m_trace = false;
|
||||||
m_debug_ref_count = false;
|
m_debug_ref_count = false;
|
||||||
m_smtlib2_compliant = false;
|
m_smtlib2_compliant = false;
|
||||||
m_well_sorted_check = false;
|
m_well_sorted_check = true;
|
||||||
m_timeout = UINT_MAX;
|
m_timeout = UINT_MAX;
|
||||||
updt_params();
|
updt_params();
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,7 +457,7 @@ namespace datalog {
|
||||||
rule * r = *it;
|
rule * r = *it;
|
||||||
app * head = r->get_head();
|
app * head = r->get_head();
|
||||||
func_decl * head_decl = head->get_decl();
|
func_decl * head_decl = head->get_decl();
|
||||||
unsigned head_strat = get_predicate_strat(head_decl);
|
// unsigned head_strat = get_predicate_strat(head_decl);
|
||||||
unsigned n = r->get_tail_size();
|
unsigned n = r->get_tail_size();
|
||||||
for (unsigned i = 0; i < n; i++) {
|
for (unsigned i = 0; i < n; i++) {
|
||||||
func_decl * tail_decl = r->get_tail(i)->get_decl();
|
func_decl * tail_decl = r->get_tail(i)->get_decl();
|
||||||
|
|
|
@ -4016,6 +4016,7 @@ namespace smt {
|
||||||
void context::set_cancel_flag(bool f) {
|
void context::set_cancel_flag(bool f) {
|
||||||
m_cancel_flag = f;
|
m_cancel_flag = f;
|
||||||
m_asserted_formulas.set_cancel_flag(f);
|
m_asserted_formulas.set_cancel_flag(f);
|
||||||
|
m_qmanager->set_cancel(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,6 +40,7 @@ namespace smt {
|
||||||
m_max_cexs(1),
|
m_max_cexs(1),
|
||||||
m_iteration_idx(0),
|
m_iteration_idx(0),
|
||||||
m_curr_model(0),
|
m_curr_model(0),
|
||||||
|
m_cancel(false),
|
||||||
m_new_instances_bindings(m) {
|
m_new_instances_bindings(m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ namespace smt {
|
||||||
unsigned m_iteration_idx;
|
unsigned m_iteration_idx;
|
||||||
proto_model * m_curr_model;
|
proto_model * m_curr_model;
|
||||||
obj_map<expr, expr *> m_value2expr;
|
obj_map<expr, expr *> m_value2expr;
|
||||||
|
bool m_cancel;
|
||||||
friend class instantiation_set;
|
friend class instantiation_set;
|
||||||
|
|
||||||
void init_aux_context();
|
void init_aux_context();
|
||||||
|
@ -92,6 +93,8 @@ namespace smt {
|
||||||
void restart_eh();
|
void restart_eh();
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
void set_cancel(bool f) { m_cancel = f; }
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ Revision History:
|
||||||
#include"well_sorted.h"
|
#include"well_sorted.h"
|
||||||
#include"model_pp.h"
|
#include"model_pp.h"
|
||||||
#include"ast_smt2_pp.h"
|
#include"ast_smt2_pp.h"
|
||||||
|
#include"cooperate.h"
|
||||||
|
#include"tactic_exception.h"
|
||||||
|
|
||||||
namespace smt {
|
namespace smt {
|
||||||
|
|
||||||
|
@ -1714,14 +1716,22 @@ namespace smt {
|
||||||
// when the quantifier is satisfied by a macro/hint, it may not be processed by the AUF solver.
|
// when the quantifier is satisfied by a macro/hint, it may not be processed by the AUF solver.
|
||||||
// in this case, the quantifier_info stores the instantiation sets.
|
// in this case, the quantifier_info stores the instantiation sets.
|
||||||
ptr_vector<instantiation_set> * m_uvar_inst_sets;
|
ptr_vector<instantiation_set> * m_uvar_inst_sets;
|
||||||
|
bool m_cancel;
|
||||||
|
|
||||||
friend class quantifier_analyzer;
|
friend class quantifier_analyzer;
|
||||||
|
|
||||||
|
void checkpoint() {
|
||||||
|
cooperate("quantifier_info");
|
||||||
|
if (m_cancel)
|
||||||
|
throw tactic_exception(TACTIC_CANCELED_MSG);
|
||||||
|
}
|
||||||
|
|
||||||
void insert_qinfo(qinfo * qi) {
|
void insert_qinfo(qinfo * qi) {
|
||||||
// I'm assuming the number of qinfo's per quantifier is small. So, the linear search is not a big deal.
|
// I'm assuming the number of qinfo's per quantifier is small. So, the linear search is not a big deal.
|
||||||
ptr_vector<qinfo>::iterator it = m_qinfo_vect.begin();
|
ptr_vector<qinfo>::iterator it = m_qinfo_vect.begin();
|
||||||
ptr_vector<qinfo>::iterator end = m_qinfo_vect.end();
|
ptr_vector<qinfo>::iterator end = m_qinfo_vect.end();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
|
checkpoint();
|
||||||
if (qi->is_equal(*it)) {
|
if (qi->is_equal(*it)) {
|
||||||
dealloc(qi);
|
dealloc(qi);
|
||||||
return;
|
return;
|
||||||
|
@ -1743,7 +1753,8 @@ namespace smt {
|
||||||
m_is_auf(true),
|
m_is_auf(true),
|
||||||
m_has_x_eq_y(false),
|
m_has_x_eq_y(false),
|
||||||
m_the_one(0),
|
m_the_one(0),
|
||||||
m_uvar_inst_sets(0) {
|
m_uvar_inst_sets(0),
|
||||||
|
m_cancel(false) {
|
||||||
if (has_quantifiers(q->get_expr())) {
|
if (has_quantifiers(q->get_expr())) {
|
||||||
static bool displayed_flat_msg = false;
|
static bool displayed_flat_msg = false;
|
||||||
if (!displayed_flat_msg) {
|
if (!displayed_flat_msg) {
|
||||||
|
@ -1896,6 +1907,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_cancel(bool f) { m_cancel = f; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1908,6 +1920,7 @@ namespace smt {
|
||||||
array_util m_array_util;
|
array_util m_array_util;
|
||||||
arith_util m_arith_util;
|
arith_util m_arith_util;
|
||||||
bv_util m_bv_util;
|
bv_util m_bv_util;
|
||||||
|
bool m_cancel;
|
||||||
|
|
||||||
quantifier_info * m_info;
|
quantifier_info * m_info;
|
||||||
|
|
||||||
|
@ -2319,8 +2332,15 @@ namespace smt {
|
||||||
visit_formula(n->get_arg(1), NEG);
|
visit_formula(n->get_arg(1), NEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void checkpoint() {
|
||||||
|
cooperate("quantifier_analyzer");
|
||||||
|
if (m_cancel)
|
||||||
|
throw tactic_exception(TACTIC_CANCELED_MSG);
|
||||||
|
}
|
||||||
|
|
||||||
void process_formulas_on_stack() {
|
void process_formulas_on_stack() {
|
||||||
while (!m_ftodo.empty()) {
|
while (!m_ftodo.empty()) {
|
||||||
|
checkpoint();
|
||||||
entry & e = m_ftodo.back();
|
entry & e = m_ftodo.back();
|
||||||
expr * curr = e.first;
|
expr * curr = e.first;
|
||||||
polarity pol = e.second;
|
polarity pol = e.second;
|
||||||
|
@ -2411,6 +2431,7 @@ namespace smt {
|
||||||
m_array_util(m),
|
m_array_util(m),
|
||||||
m_arith_util(m),
|
m_arith_util(m),
|
||||||
m_bv_util(m),
|
m_bv_util(m),
|
||||||
|
m_cancel(false),
|
||||||
m_info(0) {
|
m_info(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2441,6 +2462,11 @@ namespace smt {
|
||||||
m_info = 0;
|
m_info = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_cancel(bool f) {
|
||||||
|
m_cancel = f;
|
||||||
|
if (m_info) m_info->set_cancel(f);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3259,6 +3285,7 @@ namespace smt {
|
||||||
m_sm_solver(alloc(simple_macro_solver, m, m_q2info)),
|
m_sm_solver(alloc(simple_macro_solver, m, m_q2info)),
|
||||||
m_hint_solver(alloc(hint_solver, m, m_q2info)),
|
m_hint_solver(alloc(hint_solver, m, m_q2info)),
|
||||||
m_nm_solver(alloc(non_auf_macro_solver, m, m_q2info, m_dependencies)),
|
m_nm_solver(alloc(non_auf_macro_solver, m, m_q2info, m_dependencies)),
|
||||||
|
m_cancel(false),
|
||||||
m_new_constraints(m) {
|
m_new_constraints(m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3535,4 +3562,9 @@ namespace smt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void model_finder::set_cancel(bool f) {
|
||||||
|
m_cancel = f;
|
||||||
|
m_analyzer->set_cancel(f);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,6 +50,8 @@ Revision History:
|
||||||
#include"func_decl_dependencies.h"
|
#include"func_decl_dependencies.h"
|
||||||
#include"simplifier.h"
|
#include"simplifier.h"
|
||||||
#include"proto_model.h"
|
#include"proto_model.h"
|
||||||
|
#include"cooperate.h"
|
||||||
|
#include"tactic_exception.h"
|
||||||
|
|
||||||
namespace smt {
|
namespace smt {
|
||||||
class context;
|
class context;
|
||||||
|
@ -83,6 +85,7 @@ namespace smt {
|
||||||
scoped_ptr<simple_macro_solver> m_sm_solver;
|
scoped_ptr<simple_macro_solver> m_sm_solver;
|
||||||
scoped_ptr<hint_solver> m_hint_solver;
|
scoped_ptr<hint_solver> m_hint_solver;
|
||||||
scoped_ptr<non_auf_macro_solver> m_nm_solver;
|
scoped_ptr<non_auf_macro_solver> m_nm_solver;
|
||||||
|
bool m_cancel;
|
||||||
|
|
||||||
struct scope {
|
struct scope {
|
||||||
unsigned m_quantifiers_lim;
|
unsigned m_quantifiers_lim;
|
||||||
|
@ -102,6 +105,12 @@ namespace smt {
|
||||||
void process_auf(ptr_vector<quantifier> const & qs, proto_model * m);
|
void process_auf(ptr_vector<quantifier> const & qs, proto_model * m);
|
||||||
instantiation_set const * get_uvar_inst_set(quantifier * q, unsigned i) const;
|
instantiation_set const * get_uvar_inst_set(quantifier * q, unsigned i) const;
|
||||||
|
|
||||||
|
void checkpoint() {
|
||||||
|
cooperate("model_finder");
|
||||||
|
if (m_cancel)
|
||||||
|
throw tactic_exception(TACTIC_CANCELED_MSG);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
model_finder(ast_manager & m, simplifier & s);
|
model_finder(ast_manager & m, simplifier & s);
|
||||||
~model_finder();
|
~model_finder();
|
||||||
|
@ -119,6 +128,8 @@ namespace smt {
|
||||||
bool restrict_sks_to_inst_set(context * aux_ctx, quantifier * q, expr_ref_vector const & sks);
|
bool restrict_sks_to_inst_set(context * aux_ctx, quantifier * q, expr_ref_vector const & sks);
|
||||||
|
|
||||||
void restart_eh();
|
void restart_eh();
|
||||||
|
|
||||||
|
void set_cancel(bool f);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -593,6 +593,8 @@ namespace smt {
|
||||||
|
|
||||||
virtual void set_cancel(bool f) {
|
virtual void set_cancel(bool f) {
|
||||||
// TODO: interrupt MAM and MBQI
|
// TODO: interrupt MAM and MBQI
|
||||||
|
m_model_finder->set_cancel(f);
|
||||||
|
m_model_checker->set_cancel(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual final_check_status final_check_eh(bool full) {
|
virtual final_check_status final_check_eh(bool full) {
|
||||||
|
|
|
@ -778,7 +778,7 @@ namespace smt {
|
||||||
TRACE("array",
|
TRACE("array",
|
||||||
tout << mk_bounded_pp(v1, get_manager()) << "\n==\n"
|
tout << mk_bounded_pp(v1, get_manager()) << "\n==\n"
|
||||||
<< mk_bounded_pp(v2, get_manager()) << "\n";);
|
<< mk_bounded_pp(v2, get_manager()) << "\n";);
|
||||||
context& ctx = get_context();
|
|
||||||
if (m_eqs.contains(v1, v2)) {
|
if (m_eqs.contains(v1, v2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue