spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
tarjan_scc.hh
1 // Copyright (C) 2012 Laboratoire de Recherche et Développement
2 // de l'Epita (LRDE).
3 //
4 // This file is part of Spot, a model checking library.
5 //
6 // Spot is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // Spot is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef SPOT_FASTTGBAALGOS_EC_TARJAN_SCC_HH
20 # define SPOT_FASTTGBAALGOS_EC_TARJAN_SCC_HH
21 
22 #include <tuple>
23 
24 #include <stack>
25 #include <map>
26 #include "misc/hash.hh"
27 
28 #include "boost/tuple/tuple.hpp"
29 
30 #include "fasttgba/fasttgba.hh"
31 #include "ec.hh"
32 #include "deadstore.hh"
33 
34 namespace spot
35 {
36  class SPOT_API tarjan_scc : public ec
37  {
38  private:
40  typedef Sgi::hash_map<const fasttgba_state*, int,
42  fasttgba_state_ptr_equal> seen_map;
43 
44  public:
45 
47  tarjan_scc(instanciator* i, std::string option = "");
48 
50  virtual ~tarjan_scc();
51 
53  bool check();
54 
57  std::string extra_info_csv();
58 
59  protected:
60 
62  void init();
63 
65  void dfs_push(fasttgba_state*);
66 
68  void dfs_pop();
69 
71  void main();
72 
74  bool dfs_update (fasttgba_state* s);
75 
77  enum color {Alive, Dead, Unknown};
78 
79  // An element in Todo stack
81  {
83  fasttgba_succ_iterator* lasttr;
84  long unsigned int position;
85  };
86 
88  std::vector<pair_state_iter> todo;
89 
90  struct stack_entry{
91  int lowlink;
92  };
93  typedef std::vector<stack_entry> dstack_type;
94  dstack_type dstack_;
95 
96 
98  tarjan_scc::color get_color(const fasttgba_state*);
99 
101  bool counterexample_found;
102 
103  private:
104 
106  const fasttgba* a_;
107 
108 
109  std::vector<const spot::fasttgba_state*> live;
110  seen_map H;
111 
113  deadstore* deadstore_;
114 
116  const instance_automaton* inst;
117 
118  unsigned int dfs_size_;
119  unsigned int max_live_size_;
120  unsigned int max_dfs_size_;
121  int update_cpt_;
122  int roots_poped_cpt_;
123  int states_cpt_;
124  int transitions_cpt_;
125  int memory_cost_;
126  int trivial_scc_;
127  };
128 }
129 
130 #endif // SPOT_FASTTGBAALGOS_EC_TARJAN_SCC_HH
Definition: tarjan_scc.hh:90
Definition: fasttgba.hh:33
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
Abstract class for states.
Definition: state.hh:40
Definition: tarjan_scc.hh:80
Definition: ec.hh:64
A simple wrapper for an automaton.
Definition: ec.hh:40
Definition: tarjan_scc.hh:36
color
The color for a new State.
Definition: tarjan_scc.hh:77
Iterate over the successors of a state.
Definition: fasttgba_succ_iterator.hh:35
Definition: fasttgba_state.hh:76
This class represent a dead store. For now it&#39;s just a set but it can be combined with bitstate hasin...
Definition: deadstore.hh:41
Definition: fasttgba_state.hh:88
std::vector< pair_state_iter > todo
the todo stack
Definition: tarjan_scc.hh:88
Definition: ec.hh:28

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Tue Jan 21 2014 16:52:01 for spot by doxygen 1.8.5