ScopedBool scopedBool(d_inCheckSat);
d_inCheckSat = true;
+ // TODO This currently ignores conflicts (a dangerous practice).
+ d_theoryEngine->presolve();
+
// Check the problem
bool result = d_satSolver->solve();
void shutdown(){ }
+ void presolve(){
+ static int callCount = 0;
+ Debug("arith::presolve") << "TheoryArith::presolve #" << (callCount++) << endl;
+ check(FULL_EFFORT);
+ }
+
std::string identify() const { return std::string("TheoryArith"); }
private:
return RewriteComplete(in);
}
+ void presolve() {
+ Unimplemented();
+ }
+
void addSharedTerm(TNode t);
void notifyEq(TNode lhs, TNode rhs);
void check(Effort e);
void propagate(Effort e) { Unimplemented(); }
void explain(TNode n, Effort e) { Unimplemented(); }
+ void presolve(){ Unimplemented(); }
+
Node getValue(TNode n, TheoryEngine* engine);
RewriteResponse preRewrite(TNode n, bool topLevel);
void check(Effort e) { Unreachable(); }
void propagate(Effort e) { Unreachable(); }
void explain(TNode n, Effort e) { Unreachable(); }
+ void presolve() { Unreachable(); }
Node getValue(TNode n, TheoryEngine* engine);
void shutdown() { }
RewriteResponse preRewrite(TNode n, bool topLevel);
void check(Effort e);
+ void presolve(){
+ Unimplemented();
+ }
+
void propagate(Effort e) {}
void explain(TNode n, Effort e) { }
*/
virtual Node getValue(TNode n, TheoryEngine* engine) = 0;
+ /**
+ * A Theory is called with presolve exactly one time per user check-sat.
+ * presolve() is called after preregistration, rewriting, and Boolean propagation,
+ * (other theories' propagation?), but the notified Theory has not yet had its check()
+ * or propagate() method called yet.
+ * A Theory may empty its assertFact() queue using get().
+ * A Theory can raise conflicts, add lemmas, and propagate literals during presolve.
+ */
+ virtual void presolve() = 0;
+
/**
* Identify this theory (for debugging, dynamic configuration,
* etc..)
return theoryOf(node)->getValue(node, this);
}/* TheoryEngine::getValue(TNode node) */
+
+bool TheoryEngine::presolve(){
+ d_theoryOut.d_conflictNode = Node::null();
+ d_theoryOut.d_propagatedLiterals.clear();
+ try {
+ //d_uf->presolve();
+ d_arith->presolve();
+ //d_arrays->presolve();
+ //d_bv->presolve();
+ } catch(const theory::Interrupted&) {
+ Debug("theory") << "TheoryEngine::presolve() => conflict" << std::endl;
+ }
+ // Return wheather we have a conflict
+ return d_theoryOut.d_conflictNode.get().isNull();
+}
+
}/* CVC4 namespace */
} catch(const theory::Interrupted&) {
Debug("theory") << "TheoryEngine::check() => conflict" << std::endl;
}
- // Return wheather we have a conflict
+ // Return whether we have a conflict
return d_theoryOut.d_conflictNode.get().isNull();
}
+ /**
+ * Calls presolve() on all active theories and returns true
+ * if one of the theories discovers a conflict.
+ */
+ bool presolve();
+
inline const std::vector<TNode>& getPropagatedLiterals() const {
return d_theoryOut.d_propagatedLiterals;
}
*/
void check(Effort level);
+ void presolve(){
+ Unimplemented();
+ }
+
/**
* Rewrites a node in the theory of uninterpreted functions.
* This is fairly basic and only ensures that atoms that are
void check(Effort level);
+ void presolve() {
+ Unimplemented();
+ }
+
/**
* Rewrites a node in the theory of uninterpreted functions.
* This is fairly basic and only ensures that atoms that are
}
}
+ void presolve() {
+ Unimplemented();
+ }
void preRegisterTerm(TNode n) {}
void propagate(Effort level) {}
void explain(TNode n, Effort level) {}
return "Fake" + d_id;
}
+ void presolve() { Unimplemented(); }
+
void preRegisterTerm(TNode) { Unimplemented(); }
void registerTerm(TNode) { Unimplemented(); }
void check(Theory::Effort) { Unimplemented(); }