Function* allocFunctionOperator( ArithOp op, Set ** domain, uint numDomain, Set * range,OverFlowBehavior overflowbehavior){
FunctionOperator* This = (FunctionOperator*) ourmalloc(sizeof(FunctionOperator));
GETFUNCTIONTYPE(This)=OPERATORFUNC;
- This->domains = allocVectorArraySet(numDomain, domain);
+ This->numDomains=numDomain;
+ This->domains = ourmalloc(numDomain * sizeof(Set *));
+ memcpy(This->domains, domain, numDomain * sizeof(Set *));
This->op=op;
This->overflowbehavior = overflowbehavior;
This->range=range;
void deleteFunction(Function* This){
switch(GETFUNCTIONTYPE(This)){
case TABLEFUNC:
- ourfree((FunctionTable*)This);
break;
case OPERATORFUNC:
- ourfree((FunctionOperator*) This);
+ ourfree(((FunctionOperator*) This)->domains);
break;
default:
ASSERT(0);
}
+ ourfree(This);
}
};
struct FunctionOperator {
- Function base;
- ArithOp op;
- VectorSet* domains;
- Set * range;
- OverFlowBehavior overflowbehavior;
+ Function base;
+ ArithOp op;
+ uint numDomains;
+ Set ** domains;
+ Set * range;
+ OverFlowBehavior overflowbehavior;
};
struct FunctionTable{
- Function base;
- Table* table;
+ Function base;
+ Table* table;
};
Function* allocFunctionOperator( ArithOp op, Set ** domain, uint numDomain, Set * range,OverFlowBehavior overflowbehavior);
enum UndefinedBehavior {IGNOREBEHAVIOR, FLAGFORCEUNDEFINED, UNDEFINEDSETSFLAG, FLAGIFFUNDEFINED};
typedef enum UndefinedBehavior UndefinedBehavior;
-enum BooleanType {ORDERCONST, BOOLEANVAR, LOGICOP, COMPARE, PREDICATEOP, TABLEPREDICATEOP};
+enum BooleanType {ORDERCONST, BOOLEANVAR, LOGICOP, PREDICATEOP, TABLEPREDICATEOP};
typedef enum BooleanType BooleanType;
enum FunctionType {TABLEFUNC, OPERATORFUNC};
struct PredicateOperator {
Predicate base;
CompOp op;
- Set** domains;
- int numDomains;
+ Set ** domains;
+ uint numDomains;
};
struct PredicateTable {
Predicate base;
- Set** domains;
- int numDomains;
Table* table;
UndefinedBehavior undefinedbehavior;
};