return visited[n];
}
+void getTypes(TNode n, std::unordered_set<TypeNode>& types)
+{
+ std::unordered_set<TNode> visited;
+ getTypes(n, types, visited);
+}
+
+void getTypes(TNode n,
+ std::unordered_set<TypeNode>& types,
+ std::unordered_set<TNode>& visited)
+{
+ std::unordered_set<TNode>::iterator it;
+ std::vector<TNode> visit;
+ TNode cur;
+ visit.push_back(n);
+ do
+ {
+ cur = visit.back();
+ visit.pop_back();
+ it = visited.find(cur);
+ if (it == visited.end())
+ {
+ visited.insert(cur);
+ types.insert(cur.getType());
+ visit.insert(visit.end(), cur.begin(), cur.end());
+ }
+ } while (!visit.empty());
+}
+
void getComponentTypes(TypeNode t, std::unordered_set<TypeNode>& types)
{
std::vector<TypeNode> toProcess;
Node substituteCaptureAvoiding(TNode n,
std::vector<Node>& src,
std::vector<Node>& dest);
+/**
+ * Collect all types in n, which adds to types all types for which a subterm
+ * of n has that type. Operators are not considered in the traversal.
+ * @param n The node under investigation
+ * @param types The set of types
+ */
+void getTypes(TNode n, std::unordered_set<TypeNode>& types);
+
+/**
+ * Collect all types in n, which adds to types all types for which a subterm
+ * of n has that type. Operators are not considered in the traversal.
+ * @param n The node under investigation
+ * @param types The set of types
+ * @param visited A cache of nodes we have already visited
+ */
+void getTypes(TNode n,
+ std::unordered_set<TypeNode>& types,
+ std::unordered_set<TNode>& visited);
/**
* Get component types in type t. This adds all types that are subterms of t