6 Function* allocFunctionOperator( ArithOp op, Set ** domain, uint numDomain, Set * range,OverFlowBehavior overflowbehavior){
7 FunctionOperator* This = (FunctionOperator*) ourmalloc(sizeof(FunctionOperator));
8 GETFUNCTIONTYPE(This)=OPERATORFUNC;
9 allocInlineArrayInitSet(&This->domains, domain, numDomain);
11 This->overflowbehavior = overflowbehavior;
16 Function* allocFunctionTable (Table* table){
17 FunctionTable* This = (FunctionTable*) ourmalloc(sizeof(FunctionTable));
18 GETFUNCTIONTYPE(This)=TABLEFUNC;
23 uint64_t applyFunctionOperator(FunctionOperator* func, uint64_t var1, uint64_t var2, bool* isInRange, bool* hasOverFlow){
34 //FIXME: Should we consider underflow as well?
39 *isInRange = existsInSet(func->range, result);
43 void deleteFunction(Function* This){
44 switch(GETFUNCTIONTYPE(This)){
48 deleteInlineArraySet(&((FunctionOperator*) This)->domains);