--- /dev/null
+#include "boolean.h"
++
++Boolean* allocBoolean(VarType t){
++ Boolean* tmp = (Boolean*) ourmalloc(sizeof (Boolean));
++ tmp->vtype=t;
++ tmp->btype=_BOOLEAN;
++ return tmp;
++}
++
++Boolean* allocBooleanOrder(Order* order,uint64_t first, uint64_t second){
++ Boolean* tmp = (Boolean*) ourmalloc(sizeof (Boolean));
++ tmp ->btype= _ORDER;
++ tmp->order = order;
++ tmp->first=first;
++ tmp->second=second;
++}
--- /dev/null
-
+#ifndef BOOLEAN_H
+#define BOOLEAN_H
+#include "classlist.h"
+#include "mymemory.h"
++#include "ops.h"
+struct Boolean {
++ VarType vtype;
++ enum BooleanType btype;
++ Order* order;
++ uint64_t first;
++ uint64_t second;
+};
++
++Boolean* allocBoolean(VarType t);
++Boolean* allocBooleanOrder(Order* order,uint64_t first, uint64_t second);
+#endif
--- /dev/null
+#ifndef FUNCTION_H
+#define FUNCTION_H
+#include "classlist.h"
+#include "mymemory.h"
+
+struct Function {
++
++ Table* table;
+};
+#endif
--- /dev/null
+#ifndef OPS_H
+#define OPS_H
+enum LogicOp {AND, OR, NOT, XOR, IMPLIES};
+enum ArithOp {ADD, SUB};
+enum CompOp {EQUALS};
+enum OrderType {PARTIAL, TOTAL};
+
+/**
+ * FLAGFORCESOVERFLOW forces the operation to overflow if the boolean flag is true
+ * OVERFLOWSETSFLAG -- sets the flag if the operation overflows
+ * FLAGIFFOVERFLOW -- flag is set iff the operation overflows
+ * IGNORE -- doesn't constrain output if the result cannot be represented
+ * WRAPAROUND -- wraps around like stand integer arithmetic
+ */
+enum OverFlowBehavior {IGNORE, WRAPAROUND, FLAGFORCESOVERFLOW, OVERFLOWSETSFLAG, FLAGIFFOVERFLOW};
+
++enum BooleanType {_ORDER, _BOOLEAN};
++
+#endif
--- /dev/null
+#include "order.h"
++#include "structs.h"
++#include "set.h"
++
++
++Order* allocOrder(enum OrderType type, Set * set){
++ Order* order = (Order*)ourmalloc(sizeof(Order));
++ order->set=set;
++ order->constraints = allocDefVectorBoolean();
++ order->type=type;
++ return order;
++}
++
++Boolean* getOrderConstraint(Order* order, uint64_t first, uint64_t second){
++ uint size = getSizeVectorInt(order->set->members);
++ //First we need to make sure that first and second are part of the list!
++ bool exist1=false, exist2=false;
++ for(int i=0; i<size; i++){
++ if(getVectorInt(order->set->members, i)==first){
++ exist1=true;
++ }else if(getVectorInt(order->set->members, i) == second){
++ exist2=true;
++ }else if(exist1 && exist2){
++ break;
++ }
++ }
++ ASSERT(exist1 && exist2);
++
++}
--- /dev/null
-
+#ifndef ORDER_H
+#define ORDER_H
+#include "classlist.h"
+#include "mymemory.h"
++#include "structs.h"
++#include "ops.h"
+struct Order {
++ enum OrderType type;
++ Set * set;
++ VectorBoolean* constraints;
+};
++
++Order* allocOrder(enum OrderType type, Set * set);
++Boolean* getOrderConstraint(Order* order,uint64_t first, uint64_t second);
+#endif
--- /dev/null
+#include "predicate.h"
++#include "structs.h"
++
++
++Predicate* allocPredicate(enum CompOp op, Set ** domain, uint numDomain){
++ Predicate* predicate = (Predicate*) ourmalloc(sizeof(Predicate));
++ predicate->domains = allocDefVectorSet();
++ for(uint i=0; i<numDomain; i++)
++ pushVectorSet(predicate->domains,domain[i]);
++ predicate->op=op;
++ return predicate;
++}
--- /dev/null
-
+#ifndef PREDICATE_H
+#define PREDICATE_H
+#include "classlist.h"
+#include "mymemory.h"
++#include "ops.h"
++#include "structs.h"
+
+struct Predicate {
++ enum CompOp op;
++ VectorSet* domains;
+};
++
++
++Predicate* allocPredicate(enum CompOp op, Set ** domain, uint numDomain);
+#endif