Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

tgba/tgbareduc.hh

Go to the documentation of this file.
00001 // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), 00002 // département Systèmes Répartis Coopératifs (SRC), Université Pierre 00003 // et Marie Curie. 00004 // 00005 // This file is part of Spot, a model checking library. 00006 // 00007 // Spot is free software; you can redistribute it and/or modify it 00008 // under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // Spot is distributed in the hope that it will be useful, but WITHOUT 00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00014 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00015 // License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Spot; see the file COPYING. If not, write to the Free 00019 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 // 02111-1307, USA. 00021 00022 #ifndef SPOT_TGBA_REDUC_HH 00023 # define SPOT_TGBA_REDUC_HH 00024 00025 #include "tgbaexplicit.hh" 00026 #include "tgbaalgos/reachiter.hh" 00027 #include "tgbaalgos/gtec/explscc.hh" 00028 #include "tgbaalgos/gtec/status.hh" 00029 00030 #include <list> 00031 00032 namespace spot 00033 { 00034 typedef Sgi::pair<const spot::state*, const spot::state*> state_couple; 00035 typedef Sgi::vector<state_couple*> simulation_relation; 00036 00037 class tgba_reduc: public tgba_explicit, 00038 public tgba_reachable_iterator_breadth_first 00039 { 00040 public: 00041 tgba_reduc(const tgba* a, 00042 const numbered_state_heap_factory* nshf 00043 = numbered_state_heap_hash_map_factory::instance()); 00044 00045 ~tgba_reduc(); 00046 00049 void prune_automata(simulation_relation* rel); 00050 00053 void quotient_state(simulation_relation* rel); 00054 00056 void prune_scc(); 00057 00059 void prune_acc(); 00060 00062 void compute_scc(); 00063 00065 virtual std::string format_state(const spot::state* state) const; 00066 00068 int get_nb_state(); 00069 int get_nb_transition(); 00070 00071 // Just for Debug !! 00072 void display_rel_sim(simulation_relation* rel, std::ostream& os); 00073 void display_scc(std::ostream& os); 00074 00075 protected: 00076 bool scc_computed_; 00077 scc_stack root_; 00078 numbered_state_heap* h_; 00079 00080 std::stack<const spot::state*> state_scc_; 00081 Sgi::hash_map<int, const spot::state*> state_scc_v_; 00082 00083 typedef Sgi::hash_map<const tgba_explicit::state*, 00084 std::list<state*>*, 00085 ptr_hash<tgba_explicit::state> > sp_map; 00086 sp_map state_predecessor_map_; 00087 00088 // For reduction using scc. 00089 typedef Sgi::hash_map<const spot::state*, int, 00090 state_ptr_hash, state_ptr_equal> seen_map; 00091 seen_map si_; 00092 seen_map* seen_; 00093 bdd acc_; 00094 00095 // Interface of tgba_reachable_iterator_breadth_first 00096 void start(); 00097 void end(); 00098 void process_state(const spot::state* s, int n, tgba_succ_iterator* si); 00099 void process_link(int in, int out, const tgba_succ_iterator* si); 00100 00102 transition* create_transition(const spot::state* source, 00103 const spot::state* dest); 00104 00105 00108 void redirect_transition(const spot::state* s, 00109 const spot::state* simul); 00110 00112 void remove_predecessor_state(const state* s, const state* p); 00113 00116 void remove_state(const spot::state* s); 00117 00121 void merge_state(const spot::state* s1, 00122 const spot::state* s2); 00123 00126 void delete_scc(); 00127 00145 bool is_alpha_ball(const spot::state* s, 00146 bdd label = bddfalse, 00147 int n = -1); 00148 00149 // Return true if we can't reach a state with 00150 // an other value of scc. 00151 bool is_terminal(const spot::state* s, 00152 int n = -1); 00153 00154 // Return false if the scc contains all the accepting condition. 00155 bool is_not_accepting(const spot::state* s, 00156 int n = -1); 00157 00160 void remove_acc(const spot::state* s); 00161 00163 void remove_scc(spot::state* s); 00164 00166 void remove_scc_depth_first(spot::state* s, int n = -1); 00167 00169 void remove_component(const spot::state* from); 00170 00171 }; 00172 } 00173 00174 #endif // SPOT_TGBA_REDUC_HH

Generated on Tue Jun 29 17:00:36 2004 for spot by doxygen 1.3.7