revert runtime file.
[repair.git] / Repair / RepairInterpreter / model.h
1 #ifndef MODEL_H
2 #define MODEL_H
3 #include "classlist.h"
4
5 class model {
6  public:
7   model(char *abstractfile, char *modelfile, char *spacefile,char *structfile, char *concretefile, char *rangefile);
8   DomainRelation * getdomainrelation(); 
9   structure *getstructure(char * name);
10   void doabstraction();  // processes the model definition rules
11   bool docheck();        // processes the internal constraints
12   void doconcrete();     // processes the external constraints
13
14   void breakspec();    // inserts faults that break the specs
15   void inserterrors(); // inserts faults that do not break the specs
16
17   NormalForm * getnormalform(Constraint *c);
18   Hashtable * gethashtable();
19   bitreader * getbitreader();
20   Guidance * getguidance();
21   int getnumconstraints();
22   Constraint * getconstraint(int i);
23   NormalForm * getnormalform(int i);
24   Repair *getrepair();
25   FieldCheck * getfieldcheck();
26   void triggerrule(Element *,char *);
27   int getnumrulenormal();
28   NormalForm * getrulenormal(int i);
29   bool subtypeof(structure *sub,structure *super);
30   typemap * gettypemap();
31   void reset();
32
33   static const double prob_breakconstraint = 1;  // the probability with which each constraint is broken when inserting errors
34   static const double prob_breakpredicate = 1; // the probability with which each predicate from the selected sentences is broken
35   static const double prob_modifyconstraint = 1;  // the probability with which each constraint is modified when inserting errors
36   static const double prob_breaksatisfiedsentence = 1;  // the probability with which each satisfied sentence is modified (broken) when inserting errors
37   static const double prob_repairbrokensentence = 1;  // the probability with which each broken sentence is modified (repaired) when inserting errors
38
39  private:
40   void parsespacefile(char *spacefile);
41   void parsestructfile(char *structfile);
42   void parseabstractfile(char *abstractfile);
43   void parseconcretefile(char *concretefile);
44   void parsemodelfile(char *modelfile);
45   void parserangefile(char *rangefile);
46
47   Hashtable *env;
48   bitreader *br;
49   Guidance * guidance;
50   Repair *repair;
51   FieldCheck *fc;
52   processabstract *pa;
53
54   structure **structurearray;     // the structure definitions
55   int numstarray;
56
57   DomainRelation *domainrelation; // the sets and relations
58
59   Rule **rulearray;               // the model definition rules 
60   int numrules;              
61   NormalForm **rulenormal;        // the model definition rules in normal form
62   int numrulenormal;
63  
64   Constraint **constraintarray;   // the internal constraints
65   int numconstraint;
66   NormalForm **constraintnormal;  // the internal constraints in normal form
67
68   Rule **concretearray;           // the external constraints
69   int numconcrete;
70
71
72   typemap * typmap;
73 };
74 #endif