tgbareduc.hh

Go to the documentation of this file.
00001 // Copyright (C) 2008, 2009 Laboratoire de Recherche et Développement
00002 // de l'Epita (LRDE).
00003 // Copyright (C) 2004, 2005, 2006 Laboratoire d'Informatique de
00004 // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
00005 // Université Pierre et Marie Curie.
00006 //
00007 // This file is part of Spot, a model checking library.
00008 //
00009 // Spot is free software; you can redistribute it and/or modify it
00010 // under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation; either version 2 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // Spot is distributed in the hope that it will be useful, but WITHOUT
00015 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00017 // License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with Spot; see the file COPYING.  If not, write to the Free
00021 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00022 // 02111-1307, USA.
00023 
00024 #ifndef SPOT_TGBA_TGBAREDUC_HH
00025 # define SPOT_TGBA_TGBAREDUC_HH
00026 
00027 #include "tgbaexplicit.hh"
00028 #include "tgbaalgos/reachiter.hh"
00029 
00030 #include <list>
00031 #include <vector>
00032 
00033 namespace spot
00034 {
00035   typedef std::pair<const spot::state*, const spot::state*> state_couple;
00036   typedef std::vector<state_couple*> simulation_relation;
00037 
00038   /*
00039     typedef std::vector<state_couple*> direct_simulation_relation;
00040     typedef std::vector<state_couple*> delayed_simulation_relation;
00041   */
00042 
00043   class direct_simulation_relation: public simulation_relation
00044   {
00045   };
00046   class delayed_simulation_relation: public simulation_relation
00047   {
00048   };
00049 
00050 
00053   class tgba_reduc:
00054     public tgba_explicit_string, public tgba_reachable_iterator_breadth_first
00055   {
00056   public:
00057     tgba_reduc(const tgba* a);
00058 
00059     ~tgba_reduc();
00060 
00063     void quotient_state(direct_simulation_relation* rel);
00064 
00067     void quotient_state(delayed_simulation_relation* rel);
00068 
00071     void delete_transitions(simulation_relation* rel);
00072 
00074     virtual std::string format_state(const spot::state* state) const;
00075 
00076     // For Debug
00077     void display_rel_sim(simulation_relation* rel, std::ostream& os);
00078     void display_scc(std::ostream& os);
00079 
00080   protected:
00081     typedef Sgi::hash_map<const tgba_explicit::state*,
00082                           std::list<state*>*,
00083                           ptr_hash<tgba_explicit::state> > sp_map;
00084     sp_map state_predecessor_map_;
00085 
00086     // Interface of tgba_reachable_iterator_breadth_first
00087     void start();
00088     void end();
00089     void process_state(const spot::state* s, int n, tgba_succ_iterator* si);
00090     void process_link(int in, int out, const tgba_succ_iterator* si);
00091 
00093     transition* create_transition(const spot::state* source,
00094                                   const spot::state* dest);
00095 
00096 
00099     void redirect_transition(const spot::state* s,
00100                              const spot::state* simul);
00101 
00103     void remove_predecessor_state(const state* s, const state* p);
00104 
00107     void remove_state(const spot::state* s);
00108 
00112     void merge_state(const spot::state* s1,
00113                      const spot::state* s2);
00114 
00118     void merge_state_delayed(const spot::state* s1,
00119                              const spot::state* s2);
00120 
00123     void delete_scc();
00124 
00142     // bool is_alpha_ball(const spot::state* s,
00143     // bdd label = bddfalse,
00144     // int n = -1);
00145 
00146     // Return true if we can't reach a state with
00147     // an other value of scc.
00148     bool is_terminal(const spot::state* s,
00149                      int n = -1);
00150 
00151     // Return false if the scc contains all the acceptance conditions.
00152     bool is_not_accepting(const spot::state* s,
00153                           int n = -1);
00154 
00157     void remove_acc(const spot::state* s);
00158 
00160     void remove_scc(spot::state* s);
00161 
00163     // void remove_scc_depth_first(spot::state* s, int n = -1);
00164 
00166     void remove_component(const spot::state* from);
00167 
00168     int nb_set_acc_cond() const;
00169 
00170   };
00171 }
00172 
00173 #endif // SPOT_TGBA_TGBAREDUC_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Feb 7 2011 14:29:29 for spot by doxygen 1.7.1