Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/constraint_compiler into...
[satune.git] / src / AST / boolean.cc
1 #include "boolean.h"
2 #include "structs.h"
3 #include "csolver.h"
4 #include "element.h"
5 #include "order.h"
6
7 Boolean::Boolean(ASTNodeType _type) :
8         ASTNode(_type),
9         polarity(P_UNDEFINED),
10         boolVal(BV_UNDEFINED),
11         parents() {
12 }
13
14 BooleanVar::BooleanVar(VarType t) :
15         Boolean(BOOLEANVAR),
16         vtype(t),
17         var(E_NULL) {
18 }
19
20 BooleanOrder::BooleanOrder(Order *_order, uint64_t _first, uint64_t _second) :
21         Boolean(ORDERCONST),
22         order(_order),
23         first(_first),
24         second(_second) {
25         order->constraints.push(this);
26 }
27
28 BooleanPredicate::BooleanPredicate(Predicate *_predicate, Element **_inputs, uint _numInputs, Boolean *_undefinedStatus) :
29         Boolean(PREDICATEOP),
30         predicate(_predicate),
31         encoding(this),
32         inputs(_inputs, _numInputs),
33         undefStatus(_undefinedStatus) {
34         for (uint i = 0; i < _numInputs; i++) {
35                 GETELEMENTPARENTS(_inputs[i])->push(this);
36         }
37 }
38
39 BooleanLogic::BooleanLogic(CSolver *solver, LogicOp _op, Boolean **array, uint asize) :
40         Boolean(LOGICOP),
41         op(_op),
42         inputs(array, asize) {
43 }
44
45 BooleanPredicate::~BooleanPredicate() {
46 }