summaryrefslogtreecommitdiff
path: root/src/theory/arith/arith_static_learner.cpp
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2011-03-18 22:22:28 +0000
committerTim King <taking@cs.nyu.edu>2011-03-18 22:22:28 +0000
commite33683b83dfe9b24ff2bce5da0c7ff8c25fbfc44 (patch)
tree4f3f1c9462bdbef9dcfe8bfea749aa9450537ac1 /src/theory/arith/arith_static_learner.cpp
parent0c03497201fb4600ea8dc6e5e8638cd7e21060a9 (diff)
- The learned clauses from the miplib trick were being added twice. This was slowing down the search. (The effect can be seen in the difference between jobs 1765 and 1755). This happened during commit -r1480 when adding the ArithStaticLearner. This has been fixed.
Diffstat (limited to 'src/theory/arith/arith_static_learner.cpp')
-rw-r--r--src/theory/arith/arith_static_learner.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/theory/arith/arith_static_learner.cpp b/src/theory/arith/arith_static_learner.cpp
index 6fb538fac..548651358 100644
--- a/src/theory/arith/arith_static_learner.cpp
+++ b/src/theory/arith/arith_static_learner.cpp
@@ -212,13 +212,19 @@ void ArithStaticLearner::iteConstant(TNode n, NodeBuilder<>& learned){
void ArithStaticLearner::postProcess(NodeBuilder<>& learned){
+ vector<TNode> keys;
+ VarToNodeSetMap::iterator mipIter = d_miplibTrick.begin();
+ VarToNodeSetMap::iterator endMipLibTrick = d_miplibTrick.end();
+ for(; mipIter != endMipLibTrick; ++mipIter){
+ keys.push_back(mipIter->first);
+ }
// == 3-FINITE VALUE SET ==
- VarToNodeSetMap::iterator i = d_miplibTrick.begin();
- VarToNodeSetMap::iterator endMipLibTrick = d_miplibTrick.end();
- for(; i != endMipLibTrick; ++i){
- TNode var = i->first;
- const set<Node>& imps = i->second;
+ vector<TNode>::iterator keyIter = keys.begin();
+ vector<TNode>::iterator endKeys = keys.end();
+ for(; keyIter != endKeys; ++keyIter){
+ TNode var = *keyIter;
+ const set<Node>& imps = d_miplibTrick[var];
Assert(!imps.empty());
vector<Node> conditions;
@@ -253,6 +259,7 @@ void ArithStaticLearner::postProcess(NodeBuilder<>& learned){
Result isTaut = PropositionalQuery::isTautology(possibleTaut);
if(isTaut == Result(Result::VALID)){
miplibTrick(var, values, learned);
+ d_miplibTrick.erase(var);
}
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback