Resolving Conflicts ... Still there're errors that should be fixed
[satune.git] / src / AST / boolean.h
1 #ifndef BOOLEAN_H
2 #define BOOLEAN_H
3 #include "classlist.h"
4 #include "mymemory.h"
5 #include "ops.h"
6 #include "structs.h"
7 #include "astnode.h"
8 #include "functionencoding.h"
9
10 /**
11     This is a little sketchy, but apparently legit.
12     https://www.python.org/dev/peps/pep-3123/ */
13
14 #define GETBOOLEANTYPE(o) GETASTNODETYPE(o)
15 #define GETBOOLEANPARENTS(o) (&((Boolean *)(o))->parents)
16
17 struct Boolean {
18         ASTNode base;
19         VectorBoolean parents;
20 };
21
22 struct BooleanOrder {
23         Boolean base;
24         Order* order;
25         uint64_t first;
26         uint64_t second;
27 };
28
29 struct BooleanVar {
30         Boolean base;
31         VarType vtype;
32         Constraint * var;
33 };
34
35 struct BooleanLogic {
36         Boolean base;
37         LogicOp op;
38         ArrayBoolean inputs;
39 };
40
41 struct BooleanPredicate {
42         Boolean base;
43         Predicate * predicate;
44         FunctionEncoding encoding;
45         ArrayElement inputs;
46 };
47
48 Boolean * allocBoolean(VarType t);
49 Boolean * allocBooleanOrder(Order * order, uint64_t first, uint64_t second);
50 Boolean * allocBooleanPredicate(Predicate * predicate, Element ** inputs, uint numInputs);
51 Boolean * allocBooleanLogicArray(CSolver *solver, LogicOp op, Boolean ** array, uint asize);
52 void deleteBoolean(Boolean * This);
53
54 #endif