diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-12-07 09:51:32 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 09:51:32 -0600 |
commit | a062043b187afe410f0de3568f57594e74eb8d25 (patch) | |
tree | 378fb9b51d7df2aabb17991317eeed4c2a31e941 /src/theory/arith/theory_arith.cpp | |
parent | 85f14a1ba37949afbd33f38c8565dc5d45a300fe (diff) |
Do not expand theory definitions at the beginning of preprocessing (#5544)
This updates the preprocessor so that expand definitions does not expand theory symbols at the beginning of preprocessing.
This also restores the previous expandDefinitions method in arithmetic, which is required for correctly interpreting division by zero in models, but should not be applied at the beginning of preprocessing. Moreover it ensures that only partial operators are eliminated in arithmetic expandDefinitions, which required an additional argument partialOnly to arith::OperatorElim.
This adds -q to suppress warnings for many quantified regressions which now emit warnings with --check-model. This will be addressed later as part of CVC4/cvc4-wishues#43.
The purpose of this PR is two-fold:
(1) Currently our responses to get-value are incorrect for partial operators like div, mod, seq.nth since partial operators can be left unevaluated.
(2) The preprocessor should have the opportunity to rewrite and eliminate extended operators before they are expanded. This is required for addressing performance issues for non-linear arithmetic. It is also required for ensuring that trigger selection can be done properly for datatype selectors (to be addressed on a later PR).
Diffstat (limited to 'src/theory/arith/theory_arith.cpp')
-rw-r--r-- | src/theory/arith/theory_arith.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp index 247772897..b8cead4fc 100644 --- a/src/theory/arith/theory_arith.cpp +++ b/src/theory/arith/theory_arith.cpp @@ -97,6 +97,12 @@ void TheoryArith::preRegisterTerm(TNode n) d_internal->preRegisterTerm(n); } +TrustNode TheoryArith::expandDefinition(Node node) +{ + // call eliminate operators, to eliminate partial operators only + return d_arithPreproc.eliminate(node, true); +} + void TheoryArith::notifySharedTerm(TNode n) { d_internal->notifySharedTerm(n); } TrustNode TheoryArith::ppRewrite(TNode atom) @@ -140,8 +146,9 @@ TrustNode TheoryArith::ppRewriteTerms(TNode n) // theories may generate lemmas that involve non-standard operators. For // example, quantifier instantiation may use TO_INTEGER terms; SyGuS may // introduce non-standard arithmetic terms appearing in grammars. - // call eliminate operators - return d_arithPreproc.eliminate(n); + // call eliminate operators. In contrast to expandDefinitions, we eliminate + // *all* extended arithmetic operators here, including total ones. + return d_arithPreproc.eliminate(n, false); } Theory::PPAssertStatus TheoryArith::ppAssert( |