namespace CVC4 {
namespace prop {
-CnfStream::CnfStream(SatSolver *satSolver) :
+CnfStream::CnfStream(SatInputInterface *satSolver) :
d_satSolver(satSolver) {
}
-TseitinCnfStream::TseitinCnfStream(SatSolver* satSolver) :
+TseitinCnfStream::TseitinCnfStream(SatInputInterface* satSolver) :
CnfStream(satSolver) {
}
private:
/** The SAT solver we will be using */
- SatSolver *d_satSolver;
+ SatInputInterface *d_satSolver;
/** Cache of what literals have been registered to a node. */
typedef __gnu_cxx::hash_map<Node, SatLiteral, NodeHashFunction> TranslationCache;
* and sends them to the given sat solver.
* @param satSolver the sat solver to use
*/
- CnfStream(SatSolver* satSolver);
+ CnfStream(SatInputInterface* satSolver);
/**
* Destructs a CnfStream. This implementation does nothing, but we
* Constructs the stream to use the given sat solver.
* @param satSolver the sat solver to use
*/
- TseitinCnfStream(SatSolver* satSolver);
+ TseitinCnfStream(SatInputInterface* satSolver);
private:
#endif /* __CVC4_USE_MINISAT */
+/** Interface encapsulating the "input" to the solver, e.g., from the
+ * CNF converter.
+ *
+ * TODO: Is it possible to push the typedefs of SatClause and SatVariable
+ * into here, somehow?
+ */
+class SatInputInterface {
+public:
+ /** Assert a clause in the solver. */
+ virtual void addClause(SatClause& clause) = 0;
+ /** Create a new boolean variable in the solver. */
+ virtual SatVariable newVar(bool theoryAtom = false) = 0;
+};
+
/**
* The proxy class that allows us to modify the internals of the SAT solver.
* It's only accessible from the PropEngine, and should be treated with major
* care.
*/
-class SatSolver {
+class SatSolver : public SatInputInterface {
/** The prop engine we are using */
PropEngine* d_propEngine;