From: trevor_hansen Date: Wed, 12 May 2010 13:49:05 +0000 (+0000) Subject: Fix the flattenOneLevel function as per r294 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=d7ee9b87d7380226502cb321d0de78be0b779961;p=francis%2Fstp.git Fix the flattenOneLevel function as per r294 git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@759 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/simplifier/simplifier.cpp b/src/simplifier/simplifier.cpp index d05e1ac..f3d8256 100644 --- a/src/simplifier/simplifier.cpp +++ b/src/simplifier/simplifier.cpp @@ -19,7 +19,7 @@ namespace BEEV ASTNode n = a; while (true) { - ASTNode& nold = n; + ASTNode nold = n; n = FlattenOneLevel(n); if ((n == nold)) break; @@ -1348,7 +1348,7 @@ namespace BEEV //one level deep flattening ASTNode Simplifier::FlattenOneLevel(const ASTNode& a) { - Kind k = a.GetKind(); + const Kind k = a.GetKind(); if (!(BVPLUS == k || AND == k || OR == k //|| BVAND == k //|| BVOR == k @@ -1364,14 +1364,14 @@ namespace BEEV // return output; // } - ASTVec c = a.GetChildren(); + const ASTVec& c = a.GetChildren(); ASTVec o; - for (ASTVec::iterator it = c.begin(), itend = c.end(); it != itend; it++) + for (ASTVec::const_iterator it = c.begin(), itend = c.end(); it != itend; it++) { - ASTNode aaa = *it; + const ASTNode& aaa = *it; if (k == aaa.GetKind()) { - ASTVec ac = aaa.GetChildren(); + const ASTVec& ac = aaa.GetChildren(); o.insert(o.end(), ac.begin(), ac.end()); } else