diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2012-06-12 19:09:39 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2012-06-12 19:09:39 +0000 |
commit | c58fa3ff70a1bb6b13ef9489159a899c4f49b004 (patch) | |
tree | 3c968ad91a35371fdd8bc77c47bc2094b017b284 /src | |
parent | c5cdb4202b65d59aafa4156664400338958a3aa1 (diff) |
bufixes and the bugs
* array now only propagates thropugh the equality engine
* assertions in the equality rewriting to ensure eq -> { eq, T, F }
Diffstat (limited to 'src')
-rw-r--r-- | src/theory/arrays/theory_arrays.cpp | 6 | ||||
-rw-r--r-- | src/theory/rewriter.cpp | 11 | ||||
-rw-r--r-- | src/theory/theory_engine.cpp | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index 0e791e39c..0cd487d32 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -719,9 +719,9 @@ void TheoryArrays::check(Effort e) { Node bk = nm->mkNode(kind::SELECT, fact[0][1], k); Node eq = d_valuation.ensureLiteral(ak.eqNode(bk)); Assert(eq.getKind() == kind::EQUAL); - d_equalityEngine.assertEquality(eq, false, fact); - propagate(eq.notNode()); - Trace("arrays-lem")<<"Arrays::addExtLemma "<< ak << " /= " << bk <<"\n"; + Node lemma = fact[0].orNode(eq.notNode()); + Trace("arrays-lem")<<"Arrays::addExtLemma " << lemma <<"\n"; + d_out->lemma(lemma); ++d_numExt; } } diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp index 0c5cada09..2e8acfa89 100644 --- a/src/theory/rewriter.cpp +++ b/src/theory/rewriter.cpp @@ -63,12 +63,20 @@ Node Rewriter::rewrite(TNode node) { } Node Rewriter::rewriteEquality(theory::TheoryId theoryId, TNode node) { + Assert(node.getKind() == kind::EQUAL); Trace("rewriter") << "Rewriter::rewriteEquality(" << theoryId << "," << node << ")"<< std::endl; - return Rewriter::callRewriteEquality(theoryId, node); + Node result = Rewriter::callRewriteEquality(theoryId, node); + Trace("rewriter") << "Rewriter::rewriteEquality(" << theoryId << "," << node << ") => " << result << std::endl; + Assert(result.getKind() == kind::EQUAL || result.isConst()); + return result; } Node Rewriter::rewriteTo(theory::TheoryId theoryId, Node node) { +#ifdef CVC4_ASSERTIONS + bool isEquality = node.getKind() == kind::EQUAL; +#endif + Trace("rewriter") << "Rewriter::rewriteTo(" << theoryId << "," << node << ")"<< std::endl; // Check if it's been cached already @@ -190,6 +198,7 @@ Node Rewriter::rewriteTo(theory::TheoryId theoryId, Node node) { // If this is the last node, just return if (rewriteStack.size() == 1) { + Assert(!isEquality || rewriteStackTop.node.getKind() == kind::EQUAL || rewriteStackTop.node.isConst()); return rewriteStackTop.node; } diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index a047b2b06..f29be08a6 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -951,7 +951,7 @@ void TheoryEngine::assertFact(TNode literal) bool TheoryEngine::propagate(TNode literal, theory::TheoryId theory) { - Debug("theory") << "TheoryEngine::propagate(" << literal << ", " << theory << ")" << std::endl; + Debug("theory::propagate") << "TheoryEngine::propagate(" << literal << ", " << theory << ")" << std::endl; d_propEngine->checkTime(); |