Fix tabbing
[satune.git] / src / AST / boolean.h
index 065ba4ac2590696b7a107e1214019aff795c5c91..15ebd52b9a3532ff0a13c5e6ca1465f8fdc87dcb 100644 (file)
@@ -3,10 +3,13 @@
 #include "classlist.h"
 #include "mymemory.h"
 #include "ops.h"
+#include "structs.h"
 
-/** 
-               This is a little sketchy, but apparently legit.
-               https://www.python.org/dev/peps/pep-3123/ */
+/**
+    This is a little sketchy, but apparently legit.
+    https://www.python.org/dev/peps/pep-3123/ */
+
+#define GETBOOLEANTYPE(o) (((Boolean *)(o))->btype)
 
 struct Boolean {
        BooleanType btype;
@@ -22,6 +25,7 @@ struct BooleanOrder {
 struct BooleanVar {
        Boolean base;
        VarType vtype;
+       Constraint * var;
 };
 
 struct BooleanLogic {
@@ -31,17 +35,25 @@ struct BooleanLogic {
        Boolean * right;
 };
 
-struct BooleanComp {
+struct BooleanPredicate {
        Boolean base;
-       CompOp op;
-       Boolean * left;
-       Boolean * right;
+       Predicate * predicate;
+       VectorElement* inputs;
 };
 
-
-
 Boolean * allocBoolean(VarType t);
 Boolean * allocBooleanOrder(Order * order, uint64_t first, uint64_t second);
-void deleteBoolean(Boolean * this);
+Boolean * allocBooleanPredicate(Predicate * predicate, Element ** inputs, uint numInputs);
+Boolean * allocBooleanLogic(LogicOp op, Boolean * left, Boolean* right);
+/**
+ * This function also save new boooleans to solver->allbooleans
+ * @param solver
+ * @param op
+ * @param array
+ * @param asize
+ * @return
+ */
+Boolean * allocBooleanLogicArray(CSolver *solver, LogicOp op, Boolean ** array, uint asize);
+void deleteBoolean(Boolean * This);
 
 #endif