1 // for the File System benchmark
4 #include "DefaultGuidance2.h"
10 /* This class tells the analysis stuff */
12 1. Source for atoms if the set is too small - can be another set or function call (assumed to be no set)
13 2. Source for atoms if relation requires atom of this set - can be another set or function call (assumed to be no set)
14 3. Removal from set - where to insert objects from this set
15 4. Insertion into set - which subset to put objects in */
17 DefGuidance2::DefGuidance2(model *m) {
21 Source DefGuidance2::sourceforsetsize(char *set) {
22 DomainRelation *dr=globalmodel->getdomainrelation();
23 DomainSet *ds=dr->getset(set);
24 while(dr->getsuperset(ds)!=NULL)
25 ds=dr->getsuperset(ds);
26 if(equivalentstrings(ds->getname(),"Block"))
27 return Source(copystr("FreeBlock"));
28 if(equivalentstrings(ds->getname(),"Inode"))
29 return Source(copystr("FreeInode"));
32 Source DefGuidance2::sourceforrelation(char *set) {
36 char * DefGuidance2::removefromset(char * set) {
37 DomainRelation *dr=globalmodel->getdomainrelation();
38 DomainSet *ds=dr->getset(set);
39 if (equivalentstrings(set,"token"))
42 if (equivalentstrings(dr->getsuperset(ds)->getname(),"UsedBlock"))
44 if (equivalentstrings(dr->getsuperset(ds)->getname(),"UsedInode"))
47 DomainSet *ss=dr->getsuperset(ds);
48 while(ss!=NULL&&ss->gettype()==DOMAINSET_PARTITION) {
49 for(int i=0;i<ss->getnumsubsets();i++) {
50 char *name=ss->getsubset(i);
51 if (!equivalentstrings(ds->getname(),name)&&
52 !equivalentstrings(ds->getname(),name)) {
55 while(ss->gettype()==DOMAINSET_PARTITION) {
56 char *name=ss->getsubset(0);
63 ss=dr->getsuperset(ss);
71 char * DefGuidance2::insertiontoset(char *set) {
72 if (equivalentstrings(set,"token"))
74 if (equivalentstrings(set,"UsedBlock"))
76 if (equivalentstrings(set,"UsedInode"))
79 DomainRelation *dr=globalmodel->getdomainrelation();
80 DomainSet *ds=dr->getset(set);
81 while (ds->gettype()==DOMAINSET_PARTITION) {
82 ds=dr->getset(ds->getsubset(0));
83 /* have to look for subset; */
88 Element * allocatebytes2(structure * st, model *m) {
89 int size=st->getsize(m->getbitreader(),m,m->gethashtable());
90 Element * e=new Element(new char[size],st);