Fix tabbing
[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
8 /**
9     This is a little sketchy, but apparently legit.
10     https://www.python.org/dev/peps/pep-3123/ */
11
12 #define GETBOOLEANTYPE(o) (((Boolean *)(o))->btype)
13
14 struct Boolean {
15         BooleanType btype;
16 };
17
18 struct BooleanOrder {
19         Boolean base;
20         Order* order;
21         uint64_t first;
22         uint64_t second;
23 };
24
25 struct BooleanVar {
26         Boolean base;
27         VarType vtype;
28         Constraint * var;
29 };
30
31 struct BooleanLogic {
32         Boolean base;
33         LogicOp op;
34         Boolean * left;
35         Boolean * right;
36 };
37
38 struct BooleanPredicate {
39         Boolean base;
40         Predicate * predicate;
41         VectorElement* inputs;
42 };
43
44 Boolean * allocBoolean(VarType t);
45 Boolean * allocBooleanOrder(Order * order, uint64_t first, uint64_t second);
46 Boolean * allocBooleanPredicate(Predicate * predicate, Element ** inputs, uint numInputs);
47 Boolean * allocBooleanLogic(LogicOp op, Boolean * left, Boolean* right);
48 /**
49  * This function also save new boooleans to solver->allbooleans
50  * @param solver
51  * @param op
52  * @param array
53  * @param asize
54  * @return
55  */
56 Boolean * allocBooleanLogicArray(CSolver *solver, LogicOp op, Boolean ** array, uint asize);
57 void deleteBoolean(Boolean * This);
58
59 #endif