spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
opt_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_OPT_OPT_TARJAN_SCC_HH
20 # define SPOT_FASTTGBAALGOS_EC_OPT_OPT_TARJAN_SCC_HH
21 
22 #include <tuple>
23 
24 #include <stack>
25 #include <map>
26 
27 #include "fasttgbaalgos/ec/ec.hh"
28 #include "fasttgbaalgos/ec/deadstore.hh"
29 #include "fasttgbaalgos/ec/lowlink_stack.hh"
30 
31 namespace spot
32 {
33 
39  class SPOT_API opt_tarjan_scc : public ec
40  {
41  protected:
43  typedef Sgi::hash_map<const fasttgba_state*, int,
46 
47  public:
48 
50  opt_tarjan_scc(instanciator* i, std::string option = "",
51  bool swarm = false);
52 
54  virtual ~opt_tarjan_scc();
55 
57  bool check();
58 
61  std::string extra_info_csv();
62 
63  protected:
64 
66  void init();
67 
69  virtual void dfs_push(fasttgba_state*);
70 
72  virtual void dfs_pop();
73 
75  virtual bool dfs_update (fasttgba_state* s);
76 
78  virtual void main();
79 
81  enum color {Alive, Dead, Unknown};
82 
83  // An element in Todo stack
85  {
87  fasttgba_succ_iterator* lasttr;
88  long unsigned int position;
89  };
90 
92  std::vector<pair_state_iter> todo;
93 
96 
98  virtual opt_tarjan_scc::color get_color(const fasttgba_state*);
99 
101  bool counterexample_found;
102 
104  const fasttgba* a_;
105 
107  std::vector<const spot::fasttgba_state*> live;
108 
111 
114 
117 
118  unsigned int dfs_size_;
119  unsigned int max_live_size_;
120  unsigned int max_dfs_size_;
127  bool swarm_;
128  };
129 
134  class SPOT_API opt_tarjan_ec : public opt_tarjan_scc
135  {
136  public:
137  opt_tarjan_ec(instanciator* i, std::string option = "")
138  : opt_tarjan_scc(i, option)
139  {}
140 
142  virtual void dfs_pop();
143 
145  virtual bool dfs_update (fasttgba_state* s);
146  };
147 }
148 
149 #endif // SPOT_FASTTGBAALGOS_EC_OPT_OPT_TARJAN_SCC_HH
stack_of_lowlink * dstack_
Use a &quot;generic&quot; lowlink stack.
Definition: opt_tarjan_scc.hh:95
Definition: opt_tarjan_scc.hh:84
int transitions_cpt_
count transitions
Definition: opt_tarjan_scc.hh:124
Definition: fasttgba.hh:33
seen_map H
the HashMap Live
Definition: opt_tarjan_scc.hh:110
const fasttgba * a_
the automaton that will be used for the Emptiness check
Definition: opt_tarjan_scc.hh:104
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
int states_cpt_
count states
Definition: opt_tarjan_scc.hh:123
bool swarm_
shall use swarming?
Definition: opt_tarjan_scc.hh:127
Abstract class for states.
Definition: state.hh:40
std::vector< pair_state_iter > todo
the todo stack
Definition: opt_tarjan_scc.hh:92
Compute the SCCs of a TGBA.
Definition: opt_tarjan_scc.hh:39
Definition: ec.hh:64
const instance_automaton * inst
The instance automaton.
Definition: opt_tarjan_scc.hh:116
Sgi::hash_map< const fasttgba_state *, int, fasttgba_state_ptr_hash, fasttgba_state_ptr_equal > seen_map
The map of visited states.
Definition: opt_tarjan_scc.hh:45
int trivial_scc_
count trivial SCCs
Definition: opt_tarjan_scc.hh:126
unsigned int max_dfs_size_
keep peack size
Definition: opt_tarjan_scc.hh:120
A simple wrapper for an automaton.
Definition: ec.hh:40
deadstore * deadstore_
The store for Deads states.
Definition: opt_tarjan_scc.hh:113
int memory_cost_
evaluates memory
Definition: opt_tarjan_scc.hh:125
int update_cpt_
count UPDATE calls
Definition: opt_tarjan_scc.hh:121
unsigned int max_live_size_
keep peack size
Definition: opt_tarjan_scc.hh:119
Iterate over the successors of a state.
Definition: fasttgba_succ_iterator.hh:35
Definition: fasttgba_state.hh:76
unsigned int dfs_size_
keep dfs size
Definition: opt_tarjan_scc.hh:118
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< const spot::fasttgba_state * > live
The live stack.
Definition: opt_tarjan_scc.hh:107
color
The color for a new State.
Definition: opt_tarjan_scc.hh:81
int roots_poped_cpt_
count UPDATE loop iterations
Definition: opt_tarjan_scc.hh:122
Definition: ec.hh:28
This class is the implementation of the tarjan-based emptiness check. It onlys needs to refine two me...
Definition: opt_tarjan_scc.hh:134

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