From 6cb816f919719ccee5f27594c409956442e102ca Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Thu, 5 May 2011 00:13:34 +0000 Subject: [PATCH] Add an extra simplification rule. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1309 e59a4935-1847-0410-ae03-e826735625c1 --- src/AST/NodeFactory/SimplifyingNodeFactory.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/AST/NodeFactory/SimplifyingNodeFactory.cpp b/src/AST/NodeFactory/SimplifyingNodeFactory.cpp index c72532d..9ee0c4f 100644 --- a/src/AST/NodeFactory/SimplifyingNodeFactory.cpp +++ b/src/AST/NodeFactory/SimplifyingNodeFactory.cpp @@ -464,6 +464,17 @@ ASTNode SimplifyingNodeFactory::CreateSimpleEQ(const ASTVec& children) } } + if (k2 == BEEV::BVPLUS && in2.Degree() ==2 && (in2[1] == in1 || in2[0] == in1)) + { + return NodeFactory::CreateNode(BEEV::EQ,bm.CreateZeroConst(width),in2[1] == in1 ? in2[0]: in2[1]); + } + + if (k1 == BEEV::BVPLUS && in1.Degree() ==2 && (in1[1] == in2 || in1[0] == in2)) + { + return NodeFactory::CreateNode(BEEV::EQ,bm.CreateZeroConst(width),in1[1] == in2 ? in1[0]: in1[1]); + } + + if (k1 == BEEV::BVCONST && k2 == BEEV::BVXOR && in2.Degree() == 2 && in2[0].GetKind() == BEEV::BVCONST ) { return NodeFactory::CreateNode(BEEV::EQ,NodeFactory::CreateTerm(BEEV::BVXOR,width,in1,in2[0] ), in2[1]); -- 2.47.3