mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
reworking cancellation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
981f8226fe
commit
baee4225a7
145 changed files with 172 additions and 958 deletions
|
@ -33,25 +33,20 @@ struct mus::imp {
|
|||
ast_manager& m;
|
||||
expr_ref_vector m_cls2expr;
|
||||
obj_map<expr, unsigned> m_expr2cls;
|
||||
volatile bool m_cancel;
|
||||
model_ref m_model;
|
||||
expr_ref_vector m_soft;
|
||||
vector<rational> m_weights;
|
||||
rational m_weight;
|
||||
|
||||
imp(solver& s, ast_manager& m):
|
||||
m_s(s), m(m), m_cls2expr(m), m_cancel(false), m_soft(m)
|
||||
m_s(s), m(m), m_cls2expr(m), m_soft(m)
|
||||
{}
|
||||
|
||||
void reset() {
|
||||
m_cls2expr.reset();
|
||||
m_expr2cls.reset();
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_cancel = f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned add_soft(expr* cls) {
|
||||
SASSERT(is_uninterp_const(cls) ||
|
||||
|
@ -216,9 +211,6 @@ lbool mus::get_mus(unsigned_vector& mus) {
|
|||
return m_imp->get_mus(mus);
|
||||
}
|
||||
|
||||
void mus::set_cancel(bool f) {
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
|
||||
void mus::reset() {
|
||||
m_imp->reset();
|
||||
|
|
|
@ -39,8 +39,6 @@ namespace opt {
|
|||
|
||||
void reset();
|
||||
|
||||
void set_cancel(bool f);
|
||||
|
||||
/**
|
||||
Instrument MUS extraction to also provide the minimal
|
||||
penalty model, if any is found.
|
||||
|
|
|
@ -195,7 +195,7 @@ public:
|
|||
opt.add_hard_constraint(*it);
|
||||
}
|
||||
lbool r = l_undef;
|
||||
cancel_eh<opt::context> eh(opt);
|
||||
cancel_eh<reslimit> eh(m.limit());
|
||||
{
|
||||
scoped_ctrl_c ctrlc(eh);
|
||||
scoped_timer timer(timeout, &eh);
|
||||
|
|
|
@ -297,11 +297,7 @@ namespace opt {
|
|||
m_context.get_relevant_labels(0, tmp);
|
||||
r.append(tmp.size(), tmp.c_ptr());
|
||||
}
|
||||
|
||||
void opt_solver::set_cancel(bool f) {
|
||||
m_context.set_cancel(f);
|
||||
}
|
||||
|
||||
|
||||
void opt_solver::set_progress_callback(progress_callback * callback) {
|
||||
m_callback = callback;
|
||||
m_context.set_progress_callback(callback);
|
||||
|
|
|
@ -100,11 +100,11 @@ namespace opt {
|
|||
virtual proof * get_proof();
|
||||
virtual std::string reason_unknown() const;
|
||||
virtual void get_labels(svector<symbol> & r);
|
||||
virtual void set_cancel(bool f);
|
||||
virtual void set_progress_callback(progress_callback * callback);
|
||||
virtual unsigned get_num_assertions() const;
|
||||
virtual expr * get_assertion(unsigned idx) const;
|
||||
virtual void display(std::ostream & out) const;
|
||||
virtual ast_manager& get_manager() { return m; }
|
||||
void set_logic(symbol const& logic);
|
||||
|
||||
smt::theory_var add_objective(app* term);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue