mirror of
https://github.com/Z3Prover/z3
synced 2025-10-01 21:49:29 +00:00
Centralize and document TRACE tags using X-macros (#7657)
* Introduce X-macro-based trace tag definition - Created trace_tags.def to centralize TRACE tag definitions - Each tag includes a symbolic name and description - Set up enum class TraceTag for type-safe usage in TRACE macros * Add script to generate Markdown documentation from trace_tags.def - Python script parses trace_tags.def and outputs trace_tags.md * Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled * trace: improve trace tag handling system with hierarchical tagging - Introduce hierarchical tag-class structure: enabling a tag class activates all child tags - Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag - Implement initial version of trace_tag.def using X(tag, tag_class, description) (class names and descriptions to be refined in a future update) * trace: replace all string-based TRACE tags with enum TraceTag - Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals * trace : add cstring header * trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py * trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h. * trace : Add TODO comment for future implementation of tag_class activation * trace : Disable code related to tag_class until implementation is ready (#7663).
This commit is contained in:
parent
d766292dab
commit
0a93ff515d
583 changed files with 8698 additions and 7299 deletions
|
@ -222,7 +222,7 @@ public:
|
|||
else {
|
||||
m_imanager.power(a, n, b);
|
||||
}
|
||||
TRACE("dep_intervals", tout << "power of "; display(tout, a) << " = ";
|
||||
TRACE(dep_intervals, tout << "power of "; display(tout, a) << " = ";
|
||||
display(tout, b) << "\n"; );
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ public:
|
|||
if (!separated_from_zero_on_lower(i)) {
|
||||
return false;
|
||||
}
|
||||
TRACE("dep_intervals", display(tout, i););
|
||||
TRACE(dep_intervals, display(tout, i););
|
||||
dep = m_dep_manager.mk_join(dep, i.m_lower_dep);
|
||||
T expl;
|
||||
linearize(dep, expl);
|
||||
|
@ -328,7 +328,7 @@ public:
|
|||
bool check_interval_for_conflict_on_zero_upper(const interval& i, u_dependency* dep, std::function<void (const T&)> f) {
|
||||
if (!separated_from_zero_on_upper(i))
|
||||
return false;
|
||||
TRACE("dep_intervals", display(tout, i););
|
||||
TRACE(dep_intervals, display(tout, i););
|
||||
dep = m_dep_manager.mk_join(dep, i.m_upper_dep);
|
||||
T expl;
|
||||
linearize(dep, expl);
|
||||
|
|
|
@ -200,7 +200,7 @@ void interval_manager<C>::nth_root(numeral const & a, unsigned n, numeral const
|
|||
m().abs(A);
|
||||
|
||||
nth_root_pos(A, n, p, lo, hi);
|
||||
STRACE("nth_root_trace",
|
||||
STRACE(nth_root_trace,
|
||||
tout << "[nth-root] ("; m().display(tout, A); tout << ")^(1/" << n << ") >= "; m().display(tout, lo); tout << "\n";
|
||||
tout << "[nth-root] ("; m().display(tout, A); tout << ")^(1/" << n << ") <= "; m().display(tout, hi); tout << "\n";);
|
||||
if (is_neg) {
|
||||
|
@ -309,7 +309,7 @@ void interval_manager<C>::approx_nth_root(numeral const & A, unsigned n, numeral
|
|||
m().div(x_prime, _n, x_prime);
|
||||
m().sub(x_prime, x, d);
|
||||
m().abs(d);
|
||||
TRACE("nth_root",
|
||||
TRACE(nth_root,
|
||||
tout << "A: "; m().display(tout, A); tout << "\n";
|
||||
tout << "x: "; m().display(tout, x); tout << "\n";
|
||||
tout << "x_prime: "; m().display(tout, x_prime); tout << "\n";
|
||||
|
@ -338,7 +338,7 @@ void interval_manager<C>::nth_root_pos(numeral const & A, unsigned n, numeral co
|
|||
else {
|
||||
// Check if hi is really a upper bound for A^(n-1)
|
||||
A_div_x_n(A, hi, n-1, true /* lo will be greater than the actual lower bound */, lo);
|
||||
TRACE("nth_root_bug",
|
||||
TRACE(nth_root_bug,
|
||||
tout << "Assuming upper\n";
|
||||
tout << "A: "; m().display(tout, A); tout << "\n";
|
||||
tout << "hi: "; m().display(tout, hi); tout << "\n";
|
||||
|
@ -387,7 +387,7 @@ void interval_manager<C>::fact(unsigned n, numeral & o) {
|
|||
for (unsigned i = 2; i <= n; i++) {
|
||||
m().set(aux, static_cast<int>(i));
|
||||
m().mul(aux, o, o);
|
||||
TRACE("fact_bug", tout << "i: " << i << ", o: " << m().to_rational_string(o) << "\n";);
|
||||
TRACE(fact_bug, tout << "i: " << i << ", o: " << m().to_rational_string(o) << "\n";);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -407,24 +407,24 @@ void interval_manager<C>::sine_series(numeral const & a, unsigned k, bool upper,
|
|||
bool sign = true;
|
||||
bool upper_factor = !upper; // since the first sign is negative, we must minimize factor to maximize result
|
||||
for (unsigned i = 3; i <= k; i+=2) {
|
||||
TRACE("sine_bug", tout << "[begin-loop] o: " << m().to_rational_string(o) << "\ni: " << i << "\n";
|
||||
TRACE(sine_bug, tout << "[begin-loop] o: " << m().to_rational_string(o) << "\ni: " << i << "\n";
|
||||
tout << "upper: " << upper << ", upper_factor: " << upper_factor << "\n";
|
||||
tout << "o (default): " << m().to_string(o) << "\n";);
|
||||
set_rounding(upper_factor);
|
||||
m().power(a, i, f);
|
||||
TRACE("sine_bug", tout << "a^i " << m().to_rational_string(f) << "\n";);
|
||||
TRACE(sine_bug, tout << "a^i " << m().to_rational_string(f) << "\n";);
|
||||
set_rounding(!upper_factor);
|
||||
fact(i, aux);
|
||||
TRACE("sine_bug", tout << "i! " << m().to_rational_string(aux) << "\n";);
|
||||
TRACE(sine_bug, tout << "i! " << m().to_rational_string(aux) << "\n";);
|
||||
set_rounding(upper_factor);
|
||||
m().div(f, aux, f);
|
||||
TRACE("sine_bug", tout << "a^i/i! " << m().to_rational_string(f) << "\n";);
|
||||
TRACE(sine_bug, tout << "a^i/i! " << m().to_rational_string(f) << "\n";);
|
||||
set_rounding(upper);
|
||||
if (sign)
|
||||
m().sub(o, f, o);
|
||||
else
|
||||
m().add(o, f, o);
|
||||
TRACE("sine_bug", tout << "o: " << m().to_rational_string(o) << "\n";);
|
||||
TRACE(sine_bug, tout << "o: " << m().to_rational_string(o) << "\n";);
|
||||
sign = !sign;
|
||||
upper_factor = !upper_factor;
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ void interval_manager<C>::sine_series(numeral const & a, unsigned k, bool upper,
|
|||
|
||||
template<typename C>
|
||||
void interval_manager<C>::sine(numeral const & a, unsigned k, numeral & lo, numeral & hi) {
|
||||
TRACE("sine", tout << "sine(a), a: " << m().to_rational_string(a) << "\na: " << m().to_string(a) << "\n";);
|
||||
TRACE(sine, tout << "sine(a), a: " << m().to_rational_string(a) << "\na: " << m().to_string(a) << "\n";);
|
||||
SASSERT(&lo != &hi);
|
||||
if (m().is_zero(a)) {
|
||||
m().reset(lo);
|
||||
|
@ -456,13 +456,13 @@ void interval_manager<C>::sine(numeral const & a, unsigned k, numeral & lo, nume
|
|||
if (m().is_neg(error))
|
||||
m().neg(error);
|
||||
m().power(error, k+1, error);
|
||||
TRACE("sine", tout << "a^(k+1): " << m().to_rational_string(error) << "\nk : " << k << "\n";);
|
||||
TRACE(sine, tout << "a^(k+1): " << m().to_rational_string(error) << "\nk : " << k << "\n";);
|
||||
round_to_minus_inf();
|
||||
fact(k+1, aux);
|
||||
TRACE("sine", tout << "(k+1)!: " << m().to_rational_string(aux) << "\n";);
|
||||
TRACE(sine, tout << "(k+1)!: " << m().to_rational_string(aux) << "\n";);
|
||||
round_to_plus_inf();
|
||||
m().div(error, aux, error);
|
||||
TRACE("sine", tout << "error: " << m().to_rational_string(error) << "\n";);
|
||||
TRACE(sine, tout << "error: " << m().to_rational_string(error) << "\n";);
|
||||
|
||||
// Taylor series up to k with rounding to -oo
|
||||
sine_series(a, k, false, lo);
|
||||
|
@ -480,10 +480,10 @@ void interval_manager<C>::sine(numeral const & a, unsigned k, numeral & lo, nume
|
|||
}
|
||||
else {
|
||||
// We must recompute the series with rounding to +oo
|
||||
TRACE("sine", tout << "lo before -error: " << m().to_rational_string(lo) << "\n";);
|
||||
TRACE(sine, tout << "lo before -error: " << m().to_rational_string(lo) << "\n";);
|
||||
round_to_minus_inf();
|
||||
m().sub(lo, error, lo);
|
||||
TRACE("sine", tout << "lo: " << m().to_rational_string(lo) << "\n";);
|
||||
TRACE(sine, tout << "lo: " << m().to_rational_string(lo) << "\n";);
|
||||
if (m().lt(lo, m_minus_one)) {
|
||||
m().set(lo, -1);
|
||||
m().set(hi, 1);
|
||||
|
@ -492,7 +492,7 @@ void interval_manager<C>::sine(numeral const & a, unsigned k, numeral & lo, nume
|
|||
sine_series(a, k, true, hi);
|
||||
round_to_plus_inf();
|
||||
m().add(hi, error, hi);
|
||||
TRACE("sine", tout << "hi: " << m().to_rational_string(hi) << "\n";);
|
||||
TRACE(sine, tout << "hi: " << m().to_rational_string(hi) << "\n";);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ void interval_manager<C>::cosine_series(numeral const & a, unsigned k, bool uppe
|
|||
|
||||
template<typename C>
|
||||
void interval_manager<C>::cosine(numeral const & a, unsigned k, numeral & lo, numeral & hi) {
|
||||
TRACE("cosine", tout << "cosine(a): "; m().display_decimal(tout, a, 32); tout << "\n";);
|
||||
TRACE(cosine, tout << "cosine(a): "; m().display_decimal(tout, a, 32); tout << "\n";);
|
||||
SASSERT(&lo != &hi);
|
||||
if (m().is_zero(a)) {
|
||||
m().set(lo, 1);
|
||||
|
@ -559,7 +559,7 @@ void interval_manager<C>::cosine(numeral const & a, unsigned k, numeral & lo, nu
|
|||
fact(k+1, aux);
|
||||
round_to_plus_inf();
|
||||
m().div(error, aux, error);
|
||||
TRACE("sine", tout << "error: "; m().display_decimal(tout, error, 32); tout << "\n";);
|
||||
TRACE(sine, tout << "error: "; m().display_decimal(tout, error, 32); tout << "\n";);
|
||||
|
||||
// Taylor series up to k with rounding to -oo
|
||||
cosine_series(a, k, false, lo);
|
||||
|
@ -1049,7 +1049,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
if (is_N(i2)) {
|
||||
// x <= b <= 0, y <= d <= 0 --> b*d <= x*y
|
||||
// a <= x <= b <= 0, c <= y <= d <= 0 --> x*y <= a*c (we can use the fact that x or y is always negative (i.e., b is neg or d is neg))
|
||||
TRACE("interval_bug", tout << "(N, N) #" << call_id << "\n"; display(tout, i1); tout << "\n"; display(tout, i2); tout << "\n";
|
||||
TRACE(interval_bug, tout << "(N, N) #" << call_id << "\n"; display(tout, i1); tout << "\n"; display(tout, i2); tout << "\n";
|
||||
tout << "a: "; m().display(tout, a); tout << "\n";
|
||||
tout << "b: "; m().display(tout, b); tout << "\n";
|
||||
tout << "c: "; m().display(tout, c); tout << "\n";
|
||||
|
@ -1069,7 +1069,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
else if (is_M(i2)) {
|
||||
// a <= x <= b <= 0, y <= d, d > 0 --> a*d <= x*y (uses the fact that b is not positive)
|
||||
// a <= x <= b <= 0, c <= y, c < 0 --> x*y <= a*c (uses the fact that b is not positive)
|
||||
TRACE("interval_bug", tout << "(N, M) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(N, M) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, a_o || d_o);
|
||||
set_upper_is_open(r, a_o || c_o);
|
||||
|
@ -1082,7 +1082,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
else {
|
||||
// a <= x <= b <= 0, 0 <= c <= y <= d --> a*d <= x*y (uses the fact that x is neg (b is not positive) or y is pos (c is not negative))
|
||||
// x <= b <= 0, 0 <= c <= y --> x*y <= b*c
|
||||
TRACE("interval_bug", tout << "(N, P) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(N, P) #" << call_id << "\n";);
|
||||
SASSERT(is_P(i2));
|
||||
|
||||
// must update upper_is_open first, since value of is_N0(i1) and is_P0(i2) may be affected by update
|
||||
|
@ -1099,7 +1099,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
if (is_N(i2)) {
|
||||
// b > 0, x <= b, c <= y <= d <= 0 --> b*c <= x*y (uses the fact that d is not positive)
|
||||
// a < 0, a <= x, c <= y <= d <= 0 --> x*y <= a*c (uses the fact that d is not positive)
|
||||
TRACE("interval_bug", tout << "(M, N) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(M, N) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, b_o || c_o);
|
||||
set_upper_is_open(r, a_o || c_o);
|
||||
|
@ -1153,7 +1153,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
else {
|
||||
// a < 0, a <= x, 0 <= c <= y <= d --> a*d <= x*y (uses the fact that c is not negative)
|
||||
// b > 0, x <= b, 0 <= c <= y <= d --> x*y <= b*d (uses the fact that c is not negative)
|
||||
TRACE("interval_bug", tout << "(M, P) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(M, P) #" << call_id << "\n";);
|
||||
SASSERT(is_P(i2));
|
||||
|
||||
set_lower_is_open(r, a_o || d_o);
|
||||
|
@ -1170,7 +1170,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
if (is_N(i2)) {
|
||||
// 0 <= a <= x <= b, c <= y <= d <= 0 --> x*y <= b*c (uses the fact that x is pos (a is not neg) or y is neg (d is not pos))
|
||||
// 0 <= a <= x, y <= d <= 0 --> a*d <= x*y
|
||||
TRACE("interval_bug", tout << "(P, N) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(P, N) #" << call_id << "\n";);
|
||||
|
||||
// must update upper_is_open first, since value of is_P0(i1) and is_N0(i2) may be affected by update
|
||||
set_upper_is_open(r, (is_P0(i1) || is_N0(i2)) ? false : a_o || d_o);
|
||||
|
@ -1184,7 +1184,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
else if (is_M(i2)) {
|
||||
// 0 <= a <= x <= b, c <= y --> b*c <= x*y (uses the fact that a is not negative)
|
||||
// 0 <= a <= x <= b, y <= d --> x*y <= b*d (uses the fact that a is not negative)
|
||||
TRACE("interval_bug", tout << "(P, M) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(P, M) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, b_o || c_o);
|
||||
set_upper_is_open(r, b_o || d_o);
|
||||
|
@ -1198,7 +1198,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
SASSERT(is_P(i2));
|
||||
// 0 <= a <= x, 0 <= c <= y --> a*c <= x*y
|
||||
// x <= b, y <= d --> x*y <= b*d (uses the fact that x is pos (a is not negative) or y is pos (c is not negative))
|
||||
TRACE("interval_bug", tout << "(P, P) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(P, P) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, (is_P0(i1) || is_P0(i2)) ? false : a_o || c_o);
|
||||
set_upper_is_open(r, b_o || d_o);
|
||||
|
@ -1215,7 +1215,7 @@ void interval_manager<C>::mul(interval const & i1, interval const & i2, interval
|
|||
set_lower_is_inf(r, new_l_kind == EN_MINUS_INFINITY);
|
||||
set_upper_is_inf(r, new_u_kind == EN_PLUS_INFINITY);
|
||||
SASSERT(!(i1_contains_zero || i2_contains_zero) || contains_zero(r));
|
||||
TRACE("interval_bug", tout << "result: "; display(tout, r); tout << "\n";);
|
||||
TRACE(interval_bug, tout << "result: "; display(tout, r); tout << "\n";);
|
||||
#ifdef _TRACE
|
||||
call_id++;
|
||||
#endif
|
||||
|
@ -1336,7 +1336,7 @@ void interval_manager<C>::power(interval const & a, unsigned n, interval & b) {
|
|||
else {
|
||||
// [l, u]^n = [0, max{l^n, u^n}] otherwise
|
||||
// we need both bounds to justify upper bound
|
||||
TRACE("interval_bug", tout << "(M) #" << call_id << "\n"; display(tout, a); tout << "\nn:" << n << "\n";);
|
||||
TRACE(interval_bug, tout << "(M) #" << call_id << "\n"; display(tout, a); tout << "\nn:" << n << "\n";);
|
||||
|
||||
ext_numeral_kind un1_kind = lower_kind(a), un2_kind = upper_kind(a);
|
||||
numeral & un1 = m_result_lower;
|
||||
|
@ -1383,7 +1383,7 @@ void interval_manager<C>::power(interval const & a, unsigned n, interval & b) {
|
|||
set_upper_is_open(b, upper_is_open(a));
|
||||
}
|
||||
}
|
||||
TRACE("interval_bug", tout << "result: "; display(tout, b); tout << "\n";);
|
||||
TRACE(interval_bug, tout << "result: "; display(tout, b); tout << "\n";);
|
||||
#ifdef _TRACE
|
||||
call_id++;
|
||||
#endif
|
||||
|
@ -1432,7 +1432,7 @@ void interval_manager<C>::nth_root(interval const & a, unsigned n, numeral const
|
|||
set_upper_is_open(b, upper_is_open(a) && m().eq(lo, hi));
|
||||
m().set(upper(b), hi);
|
||||
}
|
||||
TRACE("interval_nth_root", display(tout, a); tout << " --> "; display(tout, b); tout << "\n";);
|
||||
TRACE(interval_nth_root, display(tout, a); tout << " --> "; display(tout, b); tout << "\n";);
|
||||
}
|
||||
|
||||
template<typename C>
|
||||
|
@ -1464,7 +1464,7 @@ void interval_manager<C>::xn_eq_y(interval const & y, unsigned n, numeral const
|
|||
nth_root(upper(y), n, p, lo, hi);
|
||||
// result is [-hi, hi]
|
||||
// result is open if upper(y) is open and lo == hi
|
||||
TRACE("interval_xn_eq_y", tout << "x^n = "; display(tout, y); tout << "\n";
|
||||
TRACE(interval_xn_eq_y, tout << "x^n = "; display(tout, y); tout << "\n";
|
||||
tout << "sqrt(y) in "; m().display(tout, lo); tout << " "; m().display(tout, hi); tout << "\n";);
|
||||
bool open = upper_is_open(y) && m().eq(lo, hi);
|
||||
set_lower_is_inf(x, false);
|
||||
|
@ -1475,7 +1475,7 @@ void interval_manager<C>::xn_eq_y(interval const & y, unsigned n, numeral const
|
|||
round_to_minus_inf();
|
||||
m().set(lower(x), hi);
|
||||
m().neg(lower(x));
|
||||
TRACE("interval_xn_eq_y", tout << "interval for x: "; display(tout, x); tout << "\n";);
|
||||
TRACE(interval_xn_eq_y, tout << "interval for x: "; display(tout, x); tout << "\n";);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1527,7 +1527,7 @@ void interval_manager<C>::inv(interval const & a, interval & b) {
|
|||
#endif
|
||||
// If the interval [l,u] does not contain 0, then 1/[l,u] = [1/u, 1/l]
|
||||
SASSERT(!contains_zero(a));
|
||||
TRACE("interval_bug", tout << "(inv) #" << call_id << "\n"; display(tout, a); tout << "\n";);
|
||||
TRACE(interval_bug, tout << "(inv) #" << call_id << "\n"; display(tout, a); tout << "\n";);
|
||||
|
||||
numeral & new_l_val = m_result_lower;
|
||||
numeral & new_u_val = m_result_upper;
|
||||
|
@ -1594,7 +1594,7 @@ void interval_manager<C>::inv(interval const & a, interval & b) {
|
|||
else {
|
||||
UNREACHABLE();
|
||||
}
|
||||
TRACE("interval_bug", tout << "result: "; display(tout, b); tout << "\n";);
|
||||
TRACE(interval_bug, tout << "result: "; display(tout, b); tout << "\n";);
|
||||
#ifdef _TRACE
|
||||
call_id++;
|
||||
#endif
|
||||
|
@ -1676,7 +1676,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
SASSERT(&i1 != &r);
|
||||
|
||||
if (is_zero(i1)) {
|
||||
TRACE("interval_bug", tout << "div #" << call_id << "\n"; display(tout, i1); tout << "\n"; display(tout, i2); tout << "\n";);
|
||||
TRACE(interval_bug, tout << "div #" << call_id << "\n"; display(tout, i1); tout << "\n"; display(tout, i2); tout << "\n";);
|
||||
|
||||
// 0/other = 0 if other != 0
|
||||
m().reset(lower(r));
|
||||
|
@ -1701,7 +1701,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
numeral & new_u_val = m_result_upper;
|
||||
ext_numeral_kind new_l_kind, new_u_kind;
|
||||
|
||||
TRACE("interval_bug", tout << "div #" << call_id << "\n"; display(tout, i1); tout << "\n"; display(tout, i2); tout << "\n";
|
||||
TRACE(interval_bug, tout << "div #" << call_id << "\n"; display(tout, i1); tout << "\n"; display(tout, i2); tout << "\n";
|
||||
tout << "a: "; m().display(tout, a); tout << "\n";
|
||||
tout << "b: "; m().display(tout, b); tout << "\n";
|
||||
tout << "c: "; m().display(tout, c); tout << "\n";
|
||||
|
@ -1712,7 +1712,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
if (is_N1(i2)) {
|
||||
// x <= b <= 0, c <= y <= d < 0 --> b/c <= x/y
|
||||
// a <= x <= b <= 0, y <= d < 0 --> x/y <= a/d
|
||||
TRACE("interval_bug", tout << "(N, N) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(N, N) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, is_N0(i1) ? false : b_o || c_o);
|
||||
set_upper_is_open(r, a_o || d_o);
|
||||
|
@ -1732,7 +1732,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
else {
|
||||
// a <= x, a < 0, 0 < c <= y --> a/c <= x/y
|
||||
// x <= b <= 0, 0 < c <= y <= d --> x/y <= b/d
|
||||
TRACE("interval_bug", tout << "(N, P) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(N, P) #" << call_id << "\n";);
|
||||
SASSERT(is_P1(i2));
|
||||
|
||||
set_upper_is_open(r, is_N0(i1) ? false : (b_o || d_o));
|
||||
|
@ -1755,7 +1755,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
if (is_N1(i2)) {
|
||||
// 0 < a <= x <= b < 0, y <= d < 0 --> b/d <= x/y
|
||||
// 0 < a <= x <= b < 0, y <= d < 0 --> x/y <= a/d
|
||||
TRACE("interval_bug", tout << "(M, N) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(M, N) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, b_o || d_o);
|
||||
set_upper_is_open(r, a_o || d_o);
|
||||
|
@ -1771,14 +1771,14 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
::div(m(), b, b_k, d, d_k, new_l_val, new_l_kind);
|
||||
round_to_plus_inf();
|
||||
::div(m(), a, a_k, d, d_k, new_u_val, new_u_kind);
|
||||
TRACE("interval_bug", tout << "new_l_kind: " << new_l_kind << ", new_u_kind: " << new_u_kind << "\n";);
|
||||
TRACE(interval_bug, tout << "new_l_kind: " << new_l_kind << ", new_u_kind: " << new_u_kind << "\n";);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 0 < a <= x <= b < 0, 0 < c <= y --> a/c <= x/y
|
||||
// 0 < a <= x <= b < 0, 0 < c <= y --> x/y <= b/c
|
||||
|
||||
TRACE("interval_bug", tout << "(M, P) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(M, P) #" << call_id << "\n";);
|
||||
SASSERT(is_P1(i2));
|
||||
|
||||
set_lower_is_open(r, a_o || c_o);
|
||||
|
@ -1803,7 +1803,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
if (is_N1(i2)) {
|
||||
// b > 0, x <= b, c <= y <= d < 0 --> b/d <= x/y
|
||||
// 0 <= a <= x, c <= y <= d < 0 --> x/y <= a/c
|
||||
TRACE("interval_bug", tout << "(P, N) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(P, N) #" << call_id << "\n";);
|
||||
|
||||
set_upper_is_open(r, is_P0(i1) ? false : a_o || c_o);
|
||||
set_lower_is_open(r, b_o || d_o);
|
||||
|
@ -1824,7 +1824,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
SASSERT(is_P1(i2));
|
||||
// 0 <= a <= x, 0 < c <= y <= d --> a/d <= x/y
|
||||
// b > 0 x <= b, 0 < c <= y --> x/y <= b/c
|
||||
TRACE("interval_bug", tout << "(P, P) #" << call_id << "\n";);
|
||||
TRACE(interval_bug, tout << "(P, P) #" << call_id << "\n";);
|
||||
|
||||
set_lower_is_open(r, is_P0(i1) ? false : a_o || d_o);
|
||||
set_upper_is_open(r, b_o || c_o);
|
||||
|
@ -1848,7 +1848,7 @@ void interval_manager<C>::div(interval const & i1, interval const & i2, interval
|
|||
set_lower_is_inf(r, new_l_kind == EN_MINUS_INFINITY);
|
||||
set_upper_is_inf(r, new_u_kind == EN_PLUS_INFINITY);
|
||||
}
|
||||
TRACE("interval_bug", tout << "result: "; display(tout, r); tout << "\n";);
|
||||
TRACE(interval_bug, tout << "result: "; display(tout, r); tout << "\n";);
|
||||
#ifdef _TRACE
|
||||
call_id++;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue