48bd532d52c4aade239cb49c9cc35f5cd15e00e8
[satune.git] / src / AST / table.c
1 #include "table.h"
2 #include "common.h"
3 #include "structs.h"
4 #include "tableentry.h"
5
6
7 Table * allocTable(Set **domains, uint numDomain, Set * range){
8     Table* table = (Table*) ourmalloc(sizeof(Table));
9     table->domains = allocDefVectorSet();
10     for(int i=0; i<numDomain; i++){
11         pushVectorSet(table->domains, domains[i]);
12     }
13     table->range =range;
14 }
15
16 void addNewTableEntry(Table* table, uint64_t* inputs, uint inputSize, uint64_t result){
17     ASSERT(getSizeVectorSet( table->domains) == inputSize);
18     pushVectorTableEntry(table->entries, allocTableEntry(inputs, inputSize, result));
19 }
20