From c58fa3ff70a1bb6b13ef9489159a899c4f49b004 Mon Sep 17 00:00:00 2001 From: Dejan Jovanović Date: Tue, 12 Jun 2012 19:09:39 +0000 Subject: bufixes and the bugs * array now only propagates thropugh the equality engine * assertions in the equality rewriting to ensure eq -> { eq, T, F } --- src/theory/rewriter.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/theory/rewriter.cpp') 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; } -- cgit v1.2.3