}
ASTNode
- visit(const ASTNode &n, ASTNodeMap& visited, ASTNodeSet& context)
+ visit(const ASTNode &n, ASTNodeSet& visited, ASTNodeSet& context)
{
if (n.isConstant())
return n;
- ASTNodeMap::iterator it;
- if ((it = visited.find(n)) != visited.end())
- return it->second;
+ ASTNodeSet::iterator it;
+ if (context.size() == 0 && ((it = visited.find(n)) != visited.end()))
+ return n;
if (context.find(n) != context.end())
return ASTTrue;
else
result = n;
- visited.insert(make_pair(n,result));
+ visited.insert(n);
return result;
}
topLevel(const ASTNode& n)
{
runtimes->start(RunTimes::UseITEContext);
- ASTNodeMap visited;
+ ASTNodeSet visited;
ASTNodeSet context;
ASTNode result= visit(n,visited,context);
runtimes->stop(RunTimes::UseITEContext);
+ cout << "from" << n << "to" << result;
return result;
}