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 inline ElementEncoding *getElementEncoding(){ return &encoding; }
18 virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
19 virtual void serialize(Serializer* serializer) =0;
20 virtual void updateParents() {}
21 virtual Set * getRange() = 0;
25 class ElementSet : public Element {
27 ElementSet(ASTNodeType type, Set *s);
29 virtual Element *clone(CSolver *solver, CloneMap *map);
30 virtual void serialize(Serializer* serializer);
32 Set *getRange() {return set;}
38 class ElementConst : public ElementSet {
40 ElementConst(uint64_t value, Set *_set);
42 virtual void serialize(Serializer* serializer);
43 Element *clone(CSolver *solver, CloneMap *map);
47 class ElementFunction : public Element {
49 ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
50 Array<Element *> inputs;
51 BooleanEdge overflowstatus;
52 FunctionEncoding functionencoding;
53 Element *clone(CSolver *solver, CloneMap *map);
54 virtual void serialize(Serializer* serializer);
57 Function * getFunction() {return function;}
58 inline FunctionEncoding *getElementFunctionEncoding() {return &functionencoding;}