diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-01-11 08:48:01 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 08:48:01 -0600 |
commit | ae82eb306143ade54a6f99b2aae0b62b8c77cd35 (patch) | |
tree | 1ad4dadb2ada741fbd6d43e7755a81204eadea23 /src | |
parent | fcac065b47ea73aecb90f019c07dc6fa09cd914f (diff) |
Remove extended rewrite for arithmetic (#5760)
This rewrite is no longer needed since our philosophy on rewriting extended arithmetic symbols has changed (we employ aggressive rewriting for extended arithmetic symbols in the normal rewriter). Moreover there was a soundness bug in the extended rewriter for division and mod by 0.
Fixes #5737, fixes #5740.
Diffstat (limited to 'src')
-rw-r--r-- | src/theory/quantifiers/extended_rewrite.cpp | 41 | ||||
-rw-r--r-- | src/theory/quantifiers/extended_rewrite.h | 6 |
2 files changed, 1 insertions, 46 deletions
diff --git a/src/theory/quantifiers/extended_rewrite.cpp b/src/theory/quantifiers/extended_rewrite.cpp index 6897287d6..37a3396e2 100644 --- a/src/theory/quantifiers/extended_rewrite.cpp +++ b/src/theory/quantifiers/extended_rewrite.cpp @@ -243,11 +243,7 @@ Node ExtendedRewriter::extendedRewrite(Node n) } Trace("q-ext-rewrite-debug") << "theoryOf( " << ret << " )= " << tid << std::endl; - if (tid == THEORY_ARITH) - { - new_ret = extendedRewriteArith(ret); - } - else if (tid == THEORY_STRINGS) + if (tid == THEORY_STRINGS) { new_ret = extendedRewriteStrings(ret); } @@ -1695,41 +1691,6 @@ bool ExtendedRewriter::inferSubstitution(Node n, return false; } -Node ExtendedRewriter::extendedRewriteArith(Node ret) -{ - Kind k = ret.getKind(); - NodeManager* nm = NodeManager::currentNM(); - Node new_ret; - if (k == DIVISION || k == INTS_DIVISION || k == INTS_MODULUS) - { - // rewrite as though total - std::vector<Node> children; - bool all_const = true; - for (unsigned i = 0, size = ret.getNumChildren(); i < size; i++) - { - if (ret[i].isConst()) - { - children.push_back(ret[i]); - } - else - { - all_const = false; - break; - } - } - if (all_const) - { - Kind new_k = (ret.getKind() == DIVISION ? DIVISION_TOTAL - : (ret.getKind() == INTS_DIVISION - ? INTS_DIVISION_TOTAL - : INTS_MODULUS_TOTAL)); - new_ret = nm->mkNode(new_k, children); - debugExtendedRewrite(ret, new_ret, "total-interpretation"); - } - } - return new_ret; -} - Node ExtendedRewriter::extendedRewriteStrings(Node ret) { Node new_ret; diff --git a/src/theory/quantifiers/extended_rewrite.h b/src/theory/quantifiers/extended_rewrite.h index 8b5f74a2f..e5e95b3f6 100644 --- a/src/theory/quantifiers/extended_rewrite.h +++ b/src/theory/quantifiers/extended_rewrite.h @@ -239,12 +239,6 @@ class ExtendedRewriter //--------------------------------------end generic utilities //--------------------------------------theory-specific top-level calls - /** extended rewrite arith - * - * If this method returns a non-null node ret', then ret is equivalent to - * ret'. - */ - Node extendedRewriteArith(Node ret); /** extended rewrite strings * * If this method returns a non-null node ret', then ret is equivalent to |