00001 /* 00002 * File: automata.h 00003 * Author: snippy 00004 * 00005 * Created on June 12, 2008, 10:37 AM 00006 */ 00007 00008 #ifndef _AUTOMATA_H 00009 #define _AUTOMATA_H 00010 00011 #include <ostream> 00012 #include <map> 00013 00014 class Transition; 00015 00016 class Automata; 00017 00018 class Groupe 00019 { 00020 public: 00021 list<Automata*> autos; 00022 }; 00023 00024 class State 00025 { 00026 public: 00027 Automata *automata; 00028 bool si; 00029 list<Transition*> step; 00030 int value; 00031 State(int v, bool s,Automata *a); 00032 void addTransition(Transition* t); 00033 ~State(); 00034 void display(ostream &o); 00035 }; 00036 00037 class Transition 00038 { 00039 public: 00040 int* bits; // 0 ou 1 ou -1 (pour '?') 00041 State* st; // original state 00042 Transition(State* next, int* b); 00043 void display(int bits_size); 00044 ~Transition(); 00045 }; 00046 00047 class StatePara 00048 { 00049 public: 00050 list<State*> actives; 00051 }; 00052 00053 class ExploPara 00054 { 00055 public: 00056 list<StatePara> statePara; 00057 }; 00058 00059 class Automata 00060 { 00061 public: 00062 State* si; 00063 int cvalue; 00064 int nvars; 00065 vector<int> a; 00066 int eqSize; 00067 bool isIntersect(Automata *au,int size); 00068 Automata(Condition* n, std::map <int, int>* numvars); 00069 Automata(Condition* n); 00070 ~Automata(); 00071 void display(ostream &o); 00072 }; 00073 00074 #endif /* _AUTOMATA_H */ 00075