]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Add an extra simplification rule.
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Thu, 5 May 2011 00:13:34 +0000 (00:13 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Thu, 5 May 2011 00:13:34 +0000 (00:13 +0000)
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

index c72532d2561c9de6c14dc6e2af593c133c6b5dc7..9ee0c4ffe217764fe62fce918f4ac44db43d83ea 100644 (file)
@@ -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]);