1 // defines the sets and the relations used
9 #define DOMAINSET_SUBSET 1
10 #define DOMAINSET_PARTITION 2
11 #define DOMAINSET_TYPED 0x100
16 DomainSet(char *name);
17 void settype(char *type);
18 void setsubsets(char **subsets, int numsubsets);
19 void setpartition(char **subsets, int numsubsets);
24 char *getsubset(int i);
26 char * getelementtype();
29 WorkSet *set; // the set itself
30 char *type; // the type of the elements in the set
31 char *setname; // the name of the set
33 char ** subsets;// the subsets
40 #define DRELATION_SINGDOMAIN 0x1
41 #define DRELATION_MANYDOMAIN 0x2
42 #define DRELATION_SINGRANGE 0x10
43 #define DRELATION_MANYRANGE 0x20
45 // represents a relation
48 DRelation(char *name, char *d, char *r, int t, bool);
51 WorkRelation *getrelation();
54 WorkSet *gettokenrange();
55 void settokenrange(WorkSet *ws);
63 WorkSet *tokenrange; // the actual range, if the range is of type token
65 WorkRelation *relation;
70 // manages the entire collection of sets and relations
71 class DomainRelation {
73 DomainRelation(DomainSet **s, int ns, DRelation **r,int nr);
75 DomainSet * getset(char * setname);
76 DRelation * getrelation(char * relationname);
78 WorkSet * conflictdelsets(char *setname, char *boundset);
79 WorkSet * conflictaddsets(char *setname, char *boundset, model *m);
80 WorkSet * removeconflictdelsets(char *setname);
81 WorkSet * removeconflictaddsets(char *setname, model *m);
82 DomainSet * getsuperset(DomainSet *);
83 DomainSet * getsource(DomainSet *);
84 /* Tells what set we might get objects from for a given set */
85 void delfromsetmovetoset(Element *e,DomainSet *deletefromset,model *m);
86 void abstaddtoset(Element *e,DomainSet *addtoset,model *m);
87 void addtoset(Element *e,DomainSet *addtoset,model *m);
88 bool issupersetof(DomainSet *sub,DomainSet *super);
90 DRelation * getrelation(int i);
95 bool checkrelations(DRelation *dr);
96 bool checksubset(DomainSet *ds);
97 void addallsubsets(DomainSet *ds, WorkSet *ws);
98 void removefromthisset(Element *ele, DomainSet *ds,model *m);
99 Hashtable *settable, *relationtable;
102 DRelation **relations;