mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 20:33:38 +00:00
DRAT debugging updates
This commit is contained in:
parent
6d0b89a989
commit
797f50e699
6 changed files with 19 additions and 6 deletions
|
@ -541,8 +541,6 @@ namespace smt2 {
|
||||||
unsigned epos = sexpr_stack().size();
|
unsigned epos = sexpr_stack().size();
|
||||||
SASSERT(epos >= spos);
|
SASSERT(epos >= spos);
|
||||||
unsigned num = epos - spos;
|
unsigned num = epos - spos;
|
||||||
if (num == 0)
|
|
||||||
throw parser_exception("invalid empty s-expression");
|
|
||||||
sexpr * r = sm().mk_composite(num, sexpr_stack().c_ptr() + spos, line, pos);
|
sexpr * r = sm().mk_composite(num, sexpr_stack().c_ptr() + spos, line, pos);
|
||||||
sexpr_stack().shrink(spos);
|
sexpr_stack().shrink(spos);
|
||||||
sexpr_stack().push_back(r);
|
sexpr_stack().push_back(r);
|
||||||
|
|
|
@ -112,6 +112,11 @@ namespace sat {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (n == 3 && c[0] == literal(9357, true) && c[1] == literal(25, true) && c[2] == literal(8691, false)) {
|
||||||
|
SASSERT(false);
|
||||||
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
|
||||||
if (!st.is_sat()) {
|
if (!st.is_sat()) {
|
||||||
for (char ch : m_theory[st.get_th()])
|
for (char ch : m_theory[st.get_th()])
|
||||||
buffer[len++] = ch;
|
buffer[len++] = ch;
|
||||||
|
|
|
@ -746,7 +746,6 @@ namespace dt {
|
||||||
enode* arg = n->get_arg(0);
|
enode* arg = n->get_arg(0);
|
||||||
theory_var v = mk_var(arg);
|
theory_var v = mk_var(arg);
|
||||||
add_recognizer(v, n);
|
add_recognizer(v, n);
|
||||||
mk_var(n);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SASSERT(is_accessor(term));
|
SASSERT(is_accessor(term));
|
||||||
|
|
|
@ -188,6 +188,15 @@ public:
|
||||||
result = bvu.mk_numeral(val, n);
|
result = bvu.mk_numeral(val, n);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (name == "is" && sz == 3) {
|
||||||
|
name = sexpr->get_child(2)->get_child(0)->get_symbol();
|
||||||
|
f = ctx.find_func_decl(name, params.size(), params.c_ptr(), args.size(), sorts.c_ptr(), rng.get());
|
||||||
|
if (!f)
|
||||||
|
goto bail;
|
||||||
|
datatype_util dtu(m);
|
||||||
|
result = dtu.mk_is(f, args[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (unsigned i = 2; i < sz; ++i) {
|
for (unsigned i = 2; i < sz; ++i) {
|
||||||
auto* child = sexpr->get_child(i);
|
auto* child = sexpr->get_child(i);
|
||||||
if (child->is_numeral() && child->get_numeral().is_unsigned())
|
if (child->is_numeral() && child->get_numeral().is_unsigned())
|
||||||
|
|
|
@ -64,9 +64,9 @@ bool is_debug_enabled(const char * tag);
|
||||||
#define XASSERT(COND, EXTRA_CODE) DEBUG_CODE(if (assertions_enabled() && !(COND)) { notify_assertion_violation(__FILE__, __LINE__, #COND); { EXTRA_CODE } INVOKE_DEBUGGER(); })
|
#define XASSERT(COND, EXTRA_CODE) DEBUG_CODE(if (assertions_enabled() && !(COND)) { notify_assertion_violation(__FILE__, __LINE__, #COND); { EXTRA_CODE } INVOKE_DEBUGGER(); })
|
||||||
|
|
||||||
#ifdef Z3DEBUG
|
#ifdef Z3DEBUG
|
||||||
# define UNREACHABLE() DEBUG_CODE(notify_assertion_violation(__FILE__, __LINE__, "UNREACHABLE CODE WAS REACHED."); INVOKE_DEBUGGER();)
|
# define UNREACHABLE() DEBUG_CODE(notify_assertion_violation(__FILE__, __LINE__, "UNEXPECTED CODE WAS REACHED."); INVOKE_DEBUGGER();)
|
||||||
#else
|
#else
|
||||||
# define UNREACHABLE() { notify_assertion_violation(__FILE__, __LINE__, "UNREACHABLE CODE WAS REACHED."); exit(ERR_UNREACHABLE); } ((void) 0)
|
# define UNREACHABLE() { notify_assertion_violation(__FILE__, __LINE__, "UNEXPECTED CODE WAS REACHED."); exit(ERR_UNREACHABLE); } ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Z3DEBUG
|
#ifdef Z3DEBUG
|
||||||
|
|
|
@ -194,6 +194,8 @@ void sexpr::display(std::ostream & out) const {
|
||||||
sexpr_composite const * n = todo.back().first;
|
sexpr_composite const * n = todo.back().first;
|
||||||
unsigned & idx = todo.back().second;
|
unsigned & idx = todo.back().second;
|
||||||
unsigned num = n->get_num_children();
|
unsigned num = n->get_num_children();
|
||||||
|
if (num == 0)
|
||||||
|
out << "(";
|
||||||
while (idx < num) {
|
while (idx < num) {
|
||||||
sexpr const * child = n->get_child(idx);
|
sexpr const * child = n->get_child(idx);
|
||||||
if (idx == 0)
|
if (idx == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue