3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +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
parent 981f8226fe
commit baee4225a7
145 changed files with 172 additions and 958 deletions

View file

@ -21,6 +21,7 @@ Revision History:
#include"mpq.h"
#include"ext_numeral.h"
#include"rlimit.h"
/**
\brief Default configuration for interval manager.
@ -110,6 +111,7 @@ public:
typedef typename numeral_manager::numeral numeral;
typedef typename C::interval interval;
private:
reslimit& m_limit;
C m_c;
numeral m_result_lower;
numeral m_result_upper;
@ -127,7 +129,6 @@ private:
interval m_3_pi_div_2;
interval m_2_pi;
volatile bool m_cancel;
void round_to_minus_inf() { m_c.round_to_minus_inf(); }
void round_to_plus_inf() { m_c.round_to_plus_inf(); }
@ -161,11 +162,9 @@ private:
void checkpoint();
public:
interval_manager(C const & c);
interval_manager(reslimit& lim, C const & c);
~interval_manager();
void set_cancel(bool f) { m_cancel = f; }
numeral_manager & m() const { return m_c.m(); }
void del(interval & a);

View file

@ -30,11 +30,10 @@ Revision History:
// #define TRACE_NTH_ROOT
template<typename C>
interval_manager<C>::interval_manager(C const & c):m_c(c) {
interval_manager<C>::interval_manager(reslimit& lim, C const & c): m_limit(lim), m_c(c) {
m().set(m_minus_one, -1);
m().set(m_one, 1);
m_pi_n = 0;
m_cancel = false;
}
template<typename C>
@ -63,7 +62,7 @@ void interval_manager<C>::del(interval & a) {
template<typename C>
void interval_manager<C>::checkpoint() {
if (m_cancel)
if (m_limit.canceled())
throw default_exception("canceled");
cooperate("interval");
}