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

reworking cancellation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-12-11 16:21:24 -08:00 committed by Christoph M. Wintersteiger
parent e08bfb62f8
commit 9769322690
145 changed files with 172 additions and 958 deletions

View file

@ -75,7 +75,8 @@ namespace api {
m_dtutil(m()),
m_last_result(m()),
m_ast_trail(m()),
m_replay_stack() {
m_replay_stack(),
m_pmanager(m_limit) {
m_error_code = Z3_OK;
m_print_mode = Z3_PRINT_SMTLIB_FULL;
@ -122,9 +123,8 @@ namespace api {
{
if (m_interruptable)
(*m_interruptable)();
m().set_cancel(true);
if (m_rcf_manager.get() != 0)
m_rcf_manager->set_cancel(true);
m_limit.cancel();
m().limit().cancel();
}
}
@ -323,7 +323,7 @@ namespace api {
// -----------------------
realclosure::manager & context::rcfm() {
if (m_rcf_manager.get() == 0) {
m_rcf_manager = alloc(realclosure::manager, m_rcf_qm);
m_rcf_manager = alloc(realclosure::manager, m_limit, m_rcf_qm);
}
return *(m_rcf_manager.get());
}

View file

@ -187,10 +187,12 @@ namespace api {
//
// -----------------------
private:
reslimit m_limit;
pmanager m_pmanager;
public:
polynomial::manager & pm() { return m_pmanager.pm(); }
reslimit & poly_limit() { return m_limit; }
// ------------------------
//
// RCF manager

View file

@ -29,17 +29,13 @@ Notes:
namespace api {
pmanager::pmanager():
m_pm(m_nm) {
pmanager::pmanager(reslimit& lim):
m_pm(lim, m_nm) {
}
pmanager::~pmanager() {
}
void pmanager::set_cancel(bool f) {
m_pm.set_cancel(f);
}
};
extern "C" {
@ -66,7 +62,7 @@ extern "C" {
polynomial_ref r(pm);
expr_ref _r(mk_c(c)->m());
{
cancel_eh<reslimit> eh(mk_c(c)->m().limit());
cancel_eh<reslimit> eh(mk_c(c)->poly_limit());
api::context::set_interruptable si(*(mk_c(c)), eh);
scoped_timer timer(mk_c(c)->params().m_timeout, &eh);
pm.psc_chain(_p, _q, v_x, rs);

View file

@ -28,10 +28,9 @@ namespace api {
polynomial::manager m_pm;
// TODO: add support for caching expressions -> polynomial and back
public:
pmanager();
pmanager(reslimit& limx);
virtual ~pmanager();
polynomial::manager & pm() { return m_pm; }
void set_cancel(bool f);
};
};

View file

@ -30,7 +30,7 @@ static rcmanager & rcfm(Z3_context c) {
}
static void reset_rcf_cancel(Z3_context c) {
rcfm(c).reset_cancel();
// no-op
}
static Z3_rcf_num from_rcnumeral(rcnumeral a) {