From f9991eb90d017b18437085e374914f1489588d27 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Sun, 27 Feb 2011 13:28:39 +0000 Subject: [PATCH] Bugfix. Terrible. The last checkin causes STP to sometimes return the wrong answer I suspect. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1176 e59a4935-1847-0410-ae03-e826735625c1 --- src/simplifier/UseITEContext.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/simplifier/UseITEContext.h b/src/simplifier/UseITEContext.h index ba32f9d..871ae19 100644 --- a/src/simplifier/UseITEContext.h +++ b/src/simplifier/UseITEContext.h @@ -48,14 +48,14 @@ namespace BEEV } 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; @@ -92,7 +92,7 @@ namespace BEEV else result = n; - visited.insert(make_pair(n,result)); + visited.insert(n); return result; } @@ -103,10 +103,11 @@ namespace BEEV 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; } -- 2.47.3