From: trevor_hansen Date: Tue, 9 Aug 2011 05:25:34 +0000 (+0000) Subject: Fix. If the c-interface was used to create nodes, then there would be an infinite... X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=08d97a4f4020aa844634589adc5f39161f5b6225;p=francis%2Fstp.git Fix. If the c-interface was used to create nodes, then there would be an infinite loop on the input ite(4=6,4,2). Thanks to Jingyue Wu for providing this patch. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1382 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/AST/NodeFactory/SimplifyingNodeFactory.cpp b/src/AST/NodeFactory/SimplifyingNodeFactory.cpp index faa0c7f..cb47cf0 100644 --- a/src/AST/NodeFactory/SimplifyingNodeFactory.cpp +++ b/src/AST/NodeFactory/SimplifyingNodeFactory.cpp @@ -846,9 +846,9 @@ ASTNode SimplifyingNodeFactory::CreateTerm(Kind kind, unsigned int width, result = NodeFactory::CreateTerm(BEEV::ITE, width, children[0], children[1][1], children[2]); else if (children[0].GetKind() == BEEV::NOT) result = NodeFactory::CreateTerm(BEEV::ITE, width, children[0][0], children[2], children[1]); - else if (children[0].GetKind() ==BEEV::EQ && children[0][1] == children[1] && children[0][0].GetKind() == BEEV::BVCONST) + else if (children[0].GetKind() ==BEEV::EQ && children[0][1] == children[1] && children[0][0].GetKind() == BEEV::BVCONST && children[0][1].GetKind() != BEEV::BVCONST) result = NodeFactory::CreateTerm(BEEV::ITE, width, children[0], children[0][0], children[2]); - else if (children[0].GetKind() == BEEV::EQ && children[0][0] == children[1] && children[0][1].GetKind() == BEEV::BVCONST) + else if (children[0].GetKind() == BEEV::EQ && children[0][0] == children[1] && children[0][1].GetKind() == BEEV::BVCONST && children[0][0].GetKind() != BEEV::BVCONST) result = NodeFactory::CreateTerm(BEEV::ITE, width, children[0], children[0][1], children[2]); break; }