Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File 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 00067 // For Debug 00068 void display_rel_sim(simulation_relation* rel, std::ostream& os); 00069 void display_scc(std::ostream& os); 00070 00071 protected: 00072 bool scc_computed_; 00073 scc_stack root_; 00074 numbered_state_heap* h_; 00075 00076 std::stack<const spot::state*> state_scc_; 00077 Sgi::hash_map<int, const spot::state*> state_scc_v_; 00078 00079 typedef Sgi::hash_map<const tgba_explicit::state*, 00080 std::list<state*>*, 00081 ptr_hash<tgba_explicit::state> > sp_map; 00082 sp_map state_predecessor_map_; 00083 00084 // For reduction using scc. 00085 typedef Sgi::hash_map<const spot::state*, int, 00086 state_ptr_hash, state_ptr_equal> seen_map; 00087 seen_map si_; 00088 seen_map* seen_; 00089 bdd acc_; 00090 00091 // Interface of tgba_reachable_iterator_breadth_first 00092 void start(); 00093 void end(); 00094 void process_state(const spot::state* s, int n, tgba_succ_iterator* si); 00095 void process_link(int in, int out, const tgba_succ_iterator* si); 00096 00098 transition* create_transition(const spot::state* source, 00099 const spot::state* dest); 00100 00101 00104 void redirect_transition(const spot::state* s, 00105 const spot::state* simul); 00106 00108 void remove_predecessor_state(const state* s, const state* p); 00109 00112 void remove_state(const spot::state* s); 00113 00117 void merge_state(const spot::state* s1, 00118 const spot::state* s2); 00119 00122 void delete_scc(); 00123 00141 bool is_alpha_ball(const spot::state* s, 00142 bdd label = bddfalse, 00143 int n = -1); 00144 00145 // Return true if we can't reach a state with 00146 // an other value of scc. 00147 bool is_terminal(const spot::state* s, 00148 int n = -1); 00149 00150 // Return false if the scc contains all the accepting condition. 00151 bool is_not_accepting(const spot::state* s, 00152 int n = -1); 00153 00156 void remove_acc(const spot::state* s); 00157 00159 void remove_scc(spot::state* s); 00160 00162 void remove_scc_depth_first(spot::state* s, int n = -1); 00163 00165 void remove_component(const spot::state* from); 00166 00167 }; 00168 } 00169 00170 #endif // SPOT_TGBA_REDUC_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Fri Aug 13 14:42:17 2004 for spot by doxygen 1.3.8