From: trevor_hansen Date: Mon, 16 Jan 2012 02:17:13 +0000 (+0000) Subject: Refactor. Add an extra configuration option to control always_true detection. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=b730259b73bd869b0520261107e956cf81803f52;p=francis%2Fstp.git Refactor. Add an extra configuration option to control always_true detection. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1507 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/simplifier/PropagateEqualities.cpp b/src/simplifier/PropagateEqualities.cpp index ef6e2e0..95ae005 100644 --- a/src/simplifier/PropagateEqualities.cpp +++ b/src/simplifier/PropagateEqualities.cpp @@ -37,14 +37,12 @@ namespace BEEV } else if (IFF == k || EQ == k) { - ASTVec c = a.GetChildren(); + const ASTVec& c = a.GetChildren(); if (c[0] == c[1]) return ASTTrue; - ASTNode c1 = c[1]; - - bool updated = simp->UpdateSubstitutionMap(c[0], c1); + bool updated = simp->UpdateSubstitutionMap(c[0], c[1]); output = updated ? ASTTrue : a; if (updated) @@ -52,10 +50,10 @@ namespace BEEV //fill the arrayname readindices vector if e0 is a //READ(Arr,index) and index is a BVCONST int to; - if ((to = TermOrder(c[0], c1)) == 1 && c[0].GetKind() == READ) - at->FillUp_ArrReadIndex_Vec(c[0], c1); - else if (to == -1 && c1.GetKind() == READ) - at->FillUp_ArrReadIndex_Vec(c1, c[0]); + if ((to = TermOrder(c[0], c[1])) == 1 && c[0].GetKind() == READ) + at->FillUp_ArrReadIndex_Vec(c[0], c[1]); + else if (to == -1 && c[1].GetKind() == READ) + at->FillUp_ArrReadIndex_Vec(c[1], c[0]); } } else if (XOR == k) @@ -138,7 +136,8 @@ namespace BEEV for (ASTVec::const_iterator it = c.begin(), itend = c.end(); it != itend; it++) { - simp->UpdateAlwaysTrueFormSet(*it); + if (always_true) + simp->UpdateAlwaysTrueFormSet(*it); ASTNode aaa = propagate(*it, at); if (ASTTrue != aaa) diff --git a/src/simplifier/PropagateEqualities.h b/src/simplifier/PropagateEqualities.h index 2703f4d..96217a0 100644 --- a/src/simplifier/PropagateEqualities.h +++ b/src/simplifier/PropagateEqualities.h @@ -26,10 +26,12 @@ namespace BEEV propagate(const ASTNode& a, ArrayTransformer*at); HASHSET alreadyVisited; + const bool always_true; public: PropagateEqualities(Simplifier *simp_, NodeFactory *nf_, STPMgr *bm_) : - ASTTrue(bm_->ASTTrue), ASTFalse(bm_->ASTFalse) + ASTTrue(bm_->ASTTrue), ASTFalse(bm_->ASTFalse), + always_true(bm_->UserFlags.isSet("always_true","1")) { simp = simp_; nf = nf_;