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;
21 virtual void updateParents() {}
22 virtual Set * getRange() = 0;
26 class ElementSet : public Element {
28 ElementSet(ASTNodeType type, Set *s);
30 virtual Element *clone(CSolver *solver, CloneMap *map);
31 virtual void serialize(Serializer* serializer);
34 Set *getRange() {return set;}
40 class ElementConst : public ElementSet {
42 ElementConst(uint64_t value, Set *_set);
44 virtual void serialize(Serializer* serializer);
46 Element *clone(CSolver *solver, CloneMap *map);
50 class ElementFunction : public Element {
52 ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
53 Array<Element *> inputs;
54 BooleanEdge overflowstatus;
55 FunctionEncoding functionencoding;
56 Element *clone(CSolver *solver, CloneMap *map);
57 virtual void serialize(Serializer* serializer);
61 Function * getFunction() {return function;}
62 inline FunctionEncoding *getElementFunctionEncoding() {return &functionencoding;}