spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
stats.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_STATS_HH
20 # define SPOT_FASTTGBAALGOS_EC_STATS_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 stats : 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  stats(instanciator* i, std::string option = "");
48 
50  virtual ~stats();
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  {
92  int lowlink;
93  };
94  typedef std::vector<stack_entry> dstack_type;
95  dstack_type dstack_;
96 
97 
99  stats::color get_color(const fasttgba_state*);
100 
102  bool counterexample_found;
103 
105  struct stats_entry
106  {
107  int count; // The number of SCCs
108  int ingoing_edge; // The number of internal transitions
109  int outgoing_edge; // The number of external transitions
110  int accepting; // The number of accepting SCC
111  };
112 
113  Sgi::hash_map<int, stats_entry> hstats;
114 
115  private:
116 
118  const fasttgba* a_;
119 
120 
121  std::vector<const spot::fasttgba_state*> live;
122  seen_map H;
123 
125  deadstore* deadstore_;
126 
128  const instance_automaton* inst;
129 
130  unsigned int dfs_size_;
131  unsigned int max_live_size_;
132  unsigned int max_dfs_size_;
133  int update_cpt_;
134  int roots_poped_cpt_;
135  int states_cpt_;
136  int transitions_cpt_;
137  };
138 }
139 
140 #endif // SPOT_FASTTGBAALGOS_EC_STATS_HH
color
The color for a new State.
Definition: stats.hh:77
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: stats.hh:36
Definition: ec.hh:64
Definition: stats.hh:90
A simple wrapper for an automaton.
Definition: ec.hh:40
structure to store stats about the product
Definition: stats.hh:105
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: stats.hh:88
Definition: stats.hh:80
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