2 #include "naivefunctionencoder.h"
3 #include "functionencoding.h"
9 #include "tableentry.h"
11 void naiveEncodeFunctionPredicate(Encodings* encodings, FunctionEncoding *This){
12 if(This->isFunction) {
13 ASSERT(GETELEMENTTYPE(This->op.function)==ELEMFUNCRETURN);
14 if(This->type==CIRCUIT){
15 naiveEncodeCircuitFunction(encodings, This);
16 } else if( This->type == ENUMERATEIMPLICATIONS){
17 naiveEncodeEnumeratedFunction(encodings, This);
22 ASSERT(GETBOOLEANTYPE(This->op.predicate) == PREDICATEOP);
23 BooleanPredicate* predicate = (BooleanPredicate*)This->op.predicate;
30 void naiveEncodeCircuitFunction(Encodings* encodings, FunctionEncoding* This){
34 void naiveEncodeEnumeratedFunction(Encodings* encodings, FunctionEncoding* This){
35 ElementFunction* ef =(ElementFunction*)This->op.function;
36 Function * function = ef->function;
37 if(GETFUNCTIONTYPE(function)==TABLEFUNC){
38 naiveEncodeEnumTableFunc(encodings, ef);
39 }else if (GETFUNCTIONTYPE(function)== OPERATORFUNC){
40 naiveEncodeEnumOperatingFunc(encodings, ef);
45 void naiveEncodeEnumTableFunc(Encodings* encodings, ElementFunction* This){
46 ASSERT(GETFUNCTIONTYPE(This->function)==TABLEFUNC);
47 VectorElement* elements= This->Elements;
48 Table* table = ((FunctionTable*) This->function)->table;
49 uint size = getSizeVectorTableEntry(table->entries);
50 for(uint i=0; i<size; i++){
51 TableEntry* entry = getVectorTableEntry(table->entries, i);
52 //FIXME: generate Constraints
57 void naiveEncodeEnumOperatingFunc(Encodings* encodings, ElementFunction* This){