Start work on Naive Encoders
[satune.git] / src / csolver.h
index 66c2d7e3c02cbff446e4389594dcfcf8740b8a35..d2e715c06f793e18a10b5181df19c15b92b8b18e 100644 (file)
@@ -5,10 +5,19 @@
 #include "structs.h"
 
 struct CSolver {
+       /** This is a vector of constraints that must be satisfied. */
        VectorBoolean * constraints;
+
+       /** This is a vector of all boolean structs that we have allocated. */
        VectorBoolean * allBooleans;
+
+       /** This is a vector of all set structs that we have allocated. */
        VectorSet * allSets;
+
+       /** This is a vector of all element structs that we have allocated. */
        VectorElement * allElements;
+       VectorPredicate * allPredicates;
+       VectorTable * allTables;
 };
 
 /** Create a new solver instance. */
@@ -32,8 +41,8 @@ MutableSet * createMutableSet(CSolver *, VarType type);
 void addItem(CSolver *, MutableSet * set, uint64_t element);
 
 /** This function adds a new unique item to the set and returns it.
-               This function cannot be used in conjunction with manually adding
-               items to the set. */
+    This function cannot be used in conjunction with manually adding
+    items to the set. */
 
 uint64_t createUniqueItem(CSolver *, MutableSet * set);
 
@@ -47,12 +56,12 @@ Boolean * getBooleanVar(CSolver *, VarType type);
 
 /** This function creates a function operator. */
 
-Function * createFunctionOperator(CSolver *solver, enum ArithOp op, Set ** domain, uint numDomain, Set * range,
-        enum OverFlowBehavior overflowbehavior, Boolean * overflowstatus);
+Function * createFunctionOperator(CSolver *solver, ArithOp op, Set ** domain, uint numDomain, Set * range,
+                                                                                                                                       OverFlowBehavior overflowbehavior);
 
 /** This function creates a predicate operator. */
 
-Predicate * createPredicateOperator(CSolver *solver, enum CompOp op, Set ** domain, uint numDomain);
+Predicate * createPredicateOperator(CSolver *solver, CompOp op, Set ** domain, uint numDomain);
 
 /** This function creates an empty instance table.*/
 
@@ -60,7 +69,7 @@ Table * createTable(CSolver *solver, Set **domains, uint numDomain, Set * range)
 
 /** This function adds an input output relation to a table. */
 
-void addTableEntry(CSolver *solver, uint64_t* inputs, uint inputSize, uint64_t result);
+void addTableEntry(CSolver *solver, Table* table, uint64_t* inputs, uint inputSize, uint64_t result);
 
 /** This function converts a completed table into a function. */
 
@@ -68,7 +77,7 @@ Function * completeTable(CSolver *, Table *);
 
 /** This function applies a function to the Elements in its input. */
 
-Element * applyFunction(CSolver *, Function * function, Element ** array);
+Element * applyFunction(CSolver *, Function * function, Element ** array, Boolean * overflowstatus);
 
 /** This function applies a predicate to the Elements in its input. */
 
@@ -76,16 +85,16 @@ Boolean * applyPredicate(CSolver *, Predicate * predicate, Element ** inputs);
 
 /** This function applies a logical operation to the Booleans in its input. */
 
-Boolean * applyLogicalOperation(CSolver *, enum LogicOp op, Boolean ** array);
+Boolean * applyLogicalOperation(CSolver *, LogicOp op, Boolean ** array);
 
 /** This function adds a boolean constraint to the set of constraints
-               to be satisfied */
+    to be satisfied */
 
 void addBoolean(CSolver *, Boolean * constraint);
 
 /** This function instantiates an order of type type over the set set. */
-Order * createOrder(CSolver *, enum OrderType type, Set * set);
+Order * createOrder(CSolver *, OrderType type, Set * set);
 
-/** This function instantiates a predicate on two items in an order. */
+/** This function instantiates a boolean on two items in an order. */
 Boolean * orderConstraint(CSolver *, Order * order, uint64_t first, uint64_t second);
 #endif