summaryrefslogtreecommitdiff
path: root/src/decision/justification_heuristic.cpp
diff options
context:
space:
mode:
authorKshitij Bansal <kshitij@cs.nyu.edu>2012-06-14 21:08:28 +0000
committerKshitij Bansal <kshitij@cs.nyu.edu>2012-06-14 21:08:28 +0000
commitc43514fef548f977e88e2986c2f993b975830cc2 (patch)
tree4362eb7aab0de2376813a07cbc6cc37d781528b0 /src/decision/justification_heuristic.cpp
parent66033cd2059d817cdeab5adc25f1397532a3fa78 (diff)
bug fixes in justification heuristic
* remove assert iteSkolemMap gives ite-s (not true with repeatSimp) * handle a corner case in findSplitter triggered by repeatSimp
Diffstat (limited to 'src/decision/justification_heuristic.cpp')
-rw-r--r--src/decision/justification_heuristic.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/decision/justification_heuristic.cpp b/src/decision/justification_heuristic.cpp
index 68c11295f..cd69eeb74 100644
--- a/src/decision/justification_heuristic.cpp
+++ b/src/decision/justification_heuristic.cpp
@@ -133,6 +133,13 @@ bool JustificationHeuristic::findSplitterRec(TNode node,
node = node[0];
}
+ if(Debug.isOn("decision")) {
+ if(checkJustified(node))
+ Debug("decision") << " justified, returning" << std::endl;
+ if(d_visited.find(node) != d_visited.end())
+ Debug("decision") << " visited, returning" << std::endl;
+ }
+
/* Base case */
if (checkJustified(node) || d_visited.find(node) != d_visited.end())
return false;
@@ -183,11 +190,19 @@ bool JustificationHeuristic::findSplitterRec(TNode node,
Debug("jh-ite") << " ite size = " << l.size() << std::endl;
d_visited.insert(node);
for(unsigned i = 0; i < l.size(); ++i) {
- Assert(l[i].getKind() == kind::ITE, "Expected ITE");
Debug("jh-ite") << " i = " << i
<< " l[i] = " << l[i] << std::endl;
if (checkJustified(l[i])) continue;
+ // Assert(l[i].getKind() == kind::ITE, "Expected ITE");
+ if(l[i].getKind() != kind::ITE) {
+ //this might happen because of repeatSimp
+ Debug("jh-ite") << " not an ite, must have got repeatSimp-ed"
+ << std::endl;
+ findSplitterRec(l[i], SAT_VALUE_TRUE, litDecision);
+ continue;
+ }
+
SatValue desiredVal = SAT_VALUE_TRUE; //NOTE: Reusing variable
#ifdef CVC4_ASSERTIONS
bool litPresent = d_decisionEngine->hasSatLiteral(l[i]);
@@ -206,6 +221,16 @@ bool JustificationHeuristic::findSplitterRec(TNode node,
if(findSplitterRec(l[i][0], ifDesiredVal, litDecision)) {
return true;
}
+
+ // Handle special case when if node itself is visited. Decide
+ // on it.
+ if(d_visited.find(l[i][0]) != d_visited.end()) {
+ Assert(d_decisionEngine->hasSatLiteral(l[i][0]));
+ SatVariable v = d_decisionEngine->getSatLiteral(l[i][0]).getSatVariable();
+ *litDecision = SatLiteral(v, ifDesiredVal != SAT_VALUE_TRUE );
+ return true;
+ }
+
Assert(false, "No controlling input found (1)");
} else {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback