spot  1.2.1a
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 = "", bool iskripke = false);
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  int seq_trivial;
94  int seq_trivial_sl;
95  int out_degree;
96  };
97  typedef std::vector<stack_entry> dstack_type;
98  dstack_type dstack_;
99 
100 
102  stats::color get_color(const fasttgba_state*);
103 
105  bool counterexample_found;
106 
108  struct stats_entry
109  {
110  int count; // The number of SCCs
111  int ingoing_edge; // The number of internal transitions
112  int outgoing_edge; // The number of external transitions
113  int accepting; // The number of accepting SCC
114  int strong;
115  int weak;
116  int terminal;
117  };
118 
119  Sgi::hash_map<int, stats_entry> hstats;
120  Sgi::hash_map<int, int> histo;
121 
122  private:
123 
125  const fasttgba* a_;
126 
127 
128  std::vector<const spot::fasttgba_state*> live;
129  seen_map H;
130 
132  deadstore* deadstore_;
133 
135  const instance_automaton* inst;
136 
137  unsigned int dfs_size_;
138  unsigned int max_live_size_;
139  unsigned int max_dfs_size_;
140  int update_cpt_;
141  int roots_poped_cpt_;
142  int states_cpt_;
143  int transitions_cpt_;
144 
145  int strong_states;
146  int weak_states;
147  int terminal_states;
148  int nonaccepting_states;
149 
150  int trivial_states;
151  int trivial_states_sl;
152  int trivial_states_sl_acc;
153  int nonaccepting_sccs;
154  int max_seq_trivials;
155  int max_seq_trivials_sl;
156  bool iskripke_;
157  };
158 }
159 
160 #endif // SPOT_FASTTGBAALGOS_EC_STATS_HH
this class acts like a wrapper to the C code of the open_set.
Definition: public.hh:32
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:71
Definition: stats.hh:90
A simple wrapper for an automaton.
Definition: ec.hh:40
structure to store stats about the product
Definition: stats.hh:108
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'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 Fri Jun 5 2015 11:31:18 for spot by doxygen 1.8.9.1