Big Tabbing Change
[satune.git] / src / AST / boolean.h
index d00a82cf123fa325eb1d2eadef911272df66302d..cdc05a6be55487fd5fcc5db483be2067fc920562 100644 (file)
@@ -3,20 +3,30 @@
 #include "classlist.h"
 #include "mymemory.h"
 #include "ops.h"
+#include "structs.h"
+#include "astnode.h"
+#include "functionencoding.h"
+#include "constraint.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)
+#define GETBOOLEANTYPE(o) GETASTNODETYPE(o)
+#define GETBOOLEANPARENTS(o) (&((Boolean *)(o))->parents)
+#define GETBOOLEANPOLARITY(b) (((Boolean *)b)->polarity)
+#define GETBOOLEANVALUE(b) (((Boolean *)b)->boolVal)
 
 struct Boolean {
-       BooleanType btype;
+       ASTNode base;
+       Polarity polarity;
+       BooleanValue boolVal;
+       VectorBoolean parents;
 };
 
 struct BooleanOrder {
        Boolean base;
-       Orderorder;
+       Order *order;
        uint64_t first;
        uint64_t second;
 };
@@ -24,26 +34,30 @@ struct BooleanOrder {
 struct BooleanVar {
        Boolean base;
        VarType vtype;
+       Edge var;
 };
 
 struct BooleanLogic {
        Boolean base;
        LogicOp op;
-       Boolean * left;
-       Boolean * right;
+       ArrayBoolean inputs;
 };
 
-struct BooleanComp {
+struct BooleanPredicate {
        Boolean base;
-       CompOp op;
-       Boolean * left;
-       Boolean * right;
+       Predicate *predicate;
+       FunctionEncoding encoding;
+       ArrayElement inputs;
+       Boolean *undefStatus;
 };
 
-
-
-Boolean * allocBoolean(VarType t);
-Boolean * allocBooleanOrder(Order * order, uint64_t first, uint64_t second);
-void deleteBoolean(Boolean * This);
+Boolean *allocBooleanVar(VarType t);
+Boolean *allocBooleanOrder(Order *order, uint64_t first, uint64_t second);
+Boolean *allocBooleanPredicate(Predicate *predicate, Element **inputs, uint numInputs, Boolean *undefinedStatus);
+Boolean *allocBooleanLogicArray(CSolver *solver, LogicOp op, Boolean **array, uint asize);
+void deleteBoolean(Boolean *This);
+static inline FunctionEncoding *getPredicateFunctionEncoding(BooleanPredicate *func) {
+       return &func->encoding;
+}
 
 #endif