mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
purify
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b8a81bcb09
commit
3bfc3437f1
8 changed files with 44 additions and 101 deletions
|
@ -395,7 +395,8 @@ namespace smt {
|
|||
|
||||
template<typename Ext>
|
||||
theory_var theory_arith<Ext>::internalize_div(app * n) {
|
||||
if (!m_util.is_numeral(n->get_arg(1))) found_underspecified_op(n);
|
||||
rational r;
|
||||
if (!m_util.is_numeral(n->get_arg(1), r) || r.is_zero()) found_underspecified_op(n);
|
||||
found_underspecified_op(n);
|
||||
theory_var s = mk_binary_op(n);
|
||||
context & ctx = get_context();
|
||||
|
@ -406,7 +407,8 @@ namespace smt {
|
|||
|
||||
template<typename Ext>
|
||||
theory_var theory_arith<Ext>::internalize_idiv(app * n) {
|
||||
found_underspecified_op(n);
|
||||
rational r;
|
||||
if (!m_util.is_numeral(n->get_arg(1), r) || r.is_zero()) found_underspecified_op(n);
|
||||
theory_var s = mk_binary_op(n);
|
||||
context & ctx = get_context();
|
||||
app * mod = m_util.mk_mod(n->get_arg(0), n->get_arg(1));
|
||||
|
@ -419,7 +421,8 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
theory_var theory_arith<Ext>::internalize_mod(app * n) {
|
||||
TRACE("arith_mod", tout << "internalizing...\n" << mk_pp(n, get_manager()) << "\n";);
|
||||
if (!m_util.is_numeral(n->get_arg(1))) found_underspecified_op(n);
|
||||
rational r;
|
||||
if (!m_util.is_numeral(n->get_arg(1), r) || r.is_zero()) found_underspecified_op(n);
|
||||
theory_var s = mk_binary_op(n);
|
||||
context & ctx = get_context();
|
||||
if (!ctx.relevancy())
|
||||
|
@ -429,7 +432,8 @@ namespace smt {
|
|||
|
||||
template<typename Ext>
|
||||
theory_var theory_arith<Ext>::internalize_rem(app * n) {
|
||||
if (!m_util.is_numeral(n->get_arg(1))) found_underspecified_op(n);
|
||||
rational r;
|
||||
if (!m_util.is_numeral(n->get_arg(1), r) || r.is_zero()) found_underspecified_op(n);
|
||||
theory_var s = mk_binary_op(n);
|
||||
context & ctx = get_context();
|
||||
if (!ctx.relevancy()) {
|
||||
|
@ -734,11 +738,6 @@ namespace smt {
|
|||
return internalize_div(n);
|
||||
else if (m_util.is_idiv(n))
|
||||
return internalize_idiv(n);
|
||||
else if (is_app_of(n, get_id(), OP_IDIV_0) || is_app_of(n, get_id(), OP_DIV_0)) {
|
||||
ctx.internalize(n->get_arg(0), false);
|
||||
enode * e = mk_enode(n);
|
||||
return mk_var(e);
|
||||
}
|
||||
else if (m_util.is_mod(n))
|
||||
return internalize_mod(n);
|
||||
else if (m_util.is_rem(n))
|
||||
|
|
|
@ -292,9 +292,6 @@ namespace smt {
|
|||
}
|
||||
|
||||
void found_not_handled(expr* n) {
|
||||
if (a.is_div0(n)) {
|
||||
return;
|
||||
}
|
||||
m_not_handled = n;
|
||||
if (is_app(n) && is_underspecified(to_app(n))) {
|
||||
m_underspecified.push_back(to_app(n));
|
||||
|
@ -379,7 +376,12 @@ namespace smt {
|
|||
}
|
||||
else if (is_app(n) && a.get_family_id() == to_app(n)->get_family_id()) {
|
||||
app* t = to_app(n);
|
||||
found_not_handled(n);
|
||||
if (a.is_div(n, n1, n2) && is_numeral(n2, r)) {
|
||||
// skip
|
||||
}
|
||||
else {
|
||||
found_not_handled(n);
|
||||
}
|
||||
internalize_args(t);
|
||||
mk_enode(t);
|
||||
theory_var v = mk_var(n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue