7 #include "functionencoding.h"
8 #include "elementencoding.h"
11 class Element : public ASTNode {
13 Element(ASTNodeType type);
15 Vector<ASTNode *> parents;
16 ElementEncoding encoding;
17 virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
18 virtual void updateParents() {}
19 virtual Set * getRange() = 0;
23 class ElementSet : public Element {
25 ElementSet(ASTNodeType type, Set *s);
27 virtual Element *clone(CSolver *solver, CloneMap *map);
29 Set *getRange() {return set;}
35 class ElementConst : public ElementSet {
37 ElementConst(uint64_t value, Set *_set);
39 Element *clone(CSolver *solver, CloneMap *map);
43 class ElementFunction : public Element {
45 ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
47 Array<Element *> inputs;
48 BooleanEdge overflowstatus;
49 FunctionEncoding functionencoding;
50 Element *clone(CSolver *solver, CloneMap *map);
56 static inline ElementEncoding *getElementEncoding(Element *e) {
60 static inline FunctionEncoding *getElementFunctionEncoding(ElementFunction *func) {
61 return &func->functionencoding;