#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;
- Order* order;
+ Order *order;
uint64_t first;
uint64_t second;
};
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