7 #include "functionencoding.h"
8 #include "elementencoding.h"
11 #define GETELEMENTTYPE(o) GETASTNODETYPE(o)
12 #define GETELEMENTPARENTS(o) (&((Element*)o)->parents)
13 #define GETELEMENTENCODING(e) (GETELEMENTTYPE(e)==ELEMSET? \
14 &((ElementSet*)e)->encoding: \
15 GETELEMENTTYPE(e)==ELEMFUNCRETURN? \
16 &((ElementFunction*)e)->domainencoding: NULL)
17 // Should be called on the element or boolean
18 #define GETFUNCTIONENCODING(f) (GETASTNODETYPE(f) == ELEMFUNCRETURN? \
19 &((ElementFunction*)f)->functionencoding: \
20 GETASTNODETYPE(f) == PREDICATEOP? \
21 &((BooleanPredicate*)f)->encoding: NULL)
25 VectorASTNode parents;
31 ElementEncoding encoding;
34 struct ElementFunction {
38 Boolean * overflowstatus;
39 FunctionEncoding functionencoding;
40 ElementEncoding domainencoding;
43 Element * allocElementSet(Set *s);
44 Element* allocElementFunction(Function * function, Element ** array, uint numArrays, Boolean * overflowstatus);
45 void deleteElement(Element *This);
47 uint getElementSize(Element* This);
48 Constraint * getElementValueConstraint(Element* This, uint64_t value);