Fix Node::hasFreeVar for function variables (#2216)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Fri, 27 Jul 2018 07:03:56 +0000 (02:03 -0500)
committerAndres Noetzli <andres.noetzli@gmail.com>
Fri, 27 Jul 2018 07:03:56 +0000 (00:03 -0700)
A Node has free variables if its operator has free variables.

src/expr/node.cpp

index 0503c79326ca15096656a3bdecbc4d7c1013ab50..fdb1e4d9001cd03ac3da41551f095da4234c048c 100644 (file)
@@ -181,6 +181,10 @@ bool NodeTemplate<ref_count>::hasFreeVar()
       }
       // must visit quantifiers again to clean up below
       visited[cur] = !isQuant;
+      if (cur.hasOperator())
+      {
+        visit.push_back(cur.getOperator());
+      }
       for (const TNode& cn : cur)
       {
         visit.push_back(cn);