// Delta lasts at least the duration of the function call
const Rational& delta = d_partialModel.getDelta();
+ std::hash_set<TNode, TNodeHashFunction> shared = currentlySharedTerms();
// TODO:
// This is not very good for user push/pop....
if(!isSlackVariable(v)){
Node term = d_arithvarNodeMap.asNode(v);
- const DeltaRational& mod = d_partialModel.getAssignment(v);
- Rational qmodel = mod.substituteDelta(delta);
+ if(theoryOf(term) == THEORY_ARITH || shared.find(term) != shared.end()){
+ const DeltaRational& mod = d_partialModel.getAssignment(v);
+ Rational qmodel = mod.substituteDelta(delta);
- Node qNode = mkRationalNode(qmodel);
- Debug("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl;
+ Node qNode = mkRationalNode(qmodel);
+ Debug("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl;
- m->assertEquality(term, qNode, true);
+ m->assertEquality(term, qNode, true);
+ }else{
+ Debug("arith::collectModelInfo") << "Skipping m->assertEquality(" << term << ", true)" << endl;
+
+ }
}
}
// }
//}
+std::hash_set<TNode, TNodeHashFunction> Theory::currentlySharedTerms() const{
+ std::hash_set<TNode, TNodeHashFunction> currentlyShared;
+ for(shared_terms_iterator i = shared_terms_begin(), i_end = shared_terms_end(); i != i_end; ++i){
+ currentlyShared.insert (*i);
+ }
+ return currentlyShared;
+}
}/* CVC4::theory namespace */
}/* CVC4 namespace */
#include <iostream>
#include <strings.h>
+#include <ext/hash_set>
namespace CVC4 {
return d_sharedTerms.end();
}
+
+ /**
+ * This is a utility function for constructing a copy of the currently shared terms
+ * in a queriable form. As this is
+ */
+ std::hash_set<TNode, TNodeHashFunction> currentlySharedTerms() const;
};/* class Theory */
std::ostream& operator<<(std::ostream& os, Theory::Effort level);
protected:
/** reference to the instantiation engine */
QuantifiersEngine* d_quantEngine;
+
+
public:
InstStrategy( QuantifiersEngine* qe ) : d_quantEngine( qe ){}
virtual ~InstStrategy(){}