]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Improvement? FlattenKind now recursively flattens it's children.
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Sat, 14 Aug 2010 03:44:26 +0000 (03:44 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Sat, 14 Aug 2010 03:44:26 +0000 (03:44 +0000)
I was surprised that it didn't already do this.

git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@983 e59a4935-1847-0410-ae03-e826735625c1

src/AST/ASTmisc.cpp

index 3584b06f4ba8a8dd658c6afb4b38ec032d065d4a..9520cfddf7de1387fc2740df710945a1ecad39f2 100644 (file)
@@ -163,7 +163,6 @@ bool containsArrayOps(const ASTNode&n)
 
 
   // Flatten (k ... (k ci cj) ...) to (k ... ci cj ...)
-  // This is local to this file.
   ASTVec FlattenKind(Kind k, const ASTVec &children)
   {
     ASTVec flat_children;
@@ -172,9 +171,10 @@ bool containsArrayOps(const ASTNode&n)
     for (ASTVec::const_iterator it = children.begin(); it != ch_end; it++)
       {
         Kind ck = it->GetKind();
-        const ASTVec &gchildren = it->GetChildren();
         if (k == ck)
           {
+            const ASTVec gchildren = FlattenKind(k,it->GetChildren());
+            //const ASTVec gchildren =  it->GetChildren();
             // append grandchildren to children
             flat_children.insert(flat_children.end(),
                                  gchildren.begin(), gchildren.end());