Encoding Bug Fix
[satune.git] / src / csolver.h
index bd90bf3054a5cbf85e4b506097391c2786e51d7d..1adb67932e71d60b8986a21b08b806a6dda21e8d 100644 (file)
@@ -5,6 +5,7 @@
 #include "structs.h"
 
 struct CSolver {
+       SATEncoder* satEncoder;
        /** This is a vector of constraints that must be satisfied. */
        VectorBoolean * constraints;
 
@@ -104,7 +105,7 @@ Boolean * applyLogicalOperation(CSolver *, LogicOp op, Boolean ** array, uint as
 /** This function adds a boolean constraint to the set of constraints
     to be satisfied */
 
-void addBoolean(CSolver *, Boolean * constraint);
+void addConstraint(CSolver *, Boolean * constraint);
 
 /** This function instantiates an order of type type over the set set. */
 Order * createOrder(CSolver *, OrderType type, Set * set);
@@ -113,5 +114,12 @@ Order * createOrder(CSolver *, OrderType type, Set * set);
 Boolean * orderConstraint(CSolver *, Order * order, uint64_t first, uint64_t second);
 
 /** When everything is done, the client calls this function and then csolver starts to encode*/
-void startEncoding(CSolver*);
+int startEncoding(CSolver*);
+
+/** After getting the solution from the SAT solver, client can get the value of an element via this function*/
+uint64_t getElementValue(CSolver*, Element* element);
+
+/** After getting the solution from the SAT solver, client can get the value of a boolean via this function*/
+bool getBooleanValue( CSolver* , Boolean* boolean);
+
 #endif