spot  1.2.1a
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 #include "fasttgbaalgos/ec/root_stack.hh"
31 
32 namespace spot
33 {
34 
40  class SPOT_API opt_tarjan_scc : public ec
41  {
42  protected:
44  typedef Sgi::hash_map<const fasttgba_state*, int,
47 
48  public:
49 
51  opt_tarjan_scc(instanciator* i, std::string option = "",
52  bool swarm = false, int tid = 0);
53 
55  virtual ~opt_tarjan_scc();
56 
58  bool check();
59 
62  std::string extra_info_csv();
63 
64  protected:
65 
67  void init();
68 
70  virtual void dfs_push(fasttgba_state*);
71 
73  virtual void dfs_pop();
74 
76  virtual bool dfs_update (fasttgba_state* s);
77 
79  virtual void main();
80 
82  enum color {Alive, Dead, Unknown};
83 
84  // An element in Todo stack
86  {
88  fasttgba_succ_iterator* lasttr;
89  long unsigned int position;
90  };
91 
93  std::vector<pair_state_iter> todo;
94 
97  generic_stack* stack_;
98 
100  virtual opt_tarjan_scc::color get_color(const fasttgba_state*);
101 
103  bool counterexample_found;
104 
106  const fasttgba* a_;
107 
109  std::vector<const spot::fasttgba_state*> live;
110 
112  seen_map H;
113 
116 
119 
120  unsigned int dfs_size_;
121  unsigned int max_live_size_;
122  unsigned int max_dfs_size_;
129  bool swarm_;
130  int tid_;
131  };
132 
137  class SPOT_API opt_tarjan_ec : public opt_tarjan_scc
138  {
139  public:
140  opt_tarjan_ec(instanciator* i, std::string option = "")
141  : opt_tarjan_scc(i, option)
142  {}
143 
145  virtual void dfs_pop();
146 
148  virtual bool dfs_update (fasttgba_state* s);
149  };
150 }
151 
152 #endif // SPOT_FASTTGBAALGOS_EC_OPT_OPT_TARJAN_SCC_HH
stack_of_lowlink * dstack_
Use a "generic" lowlink stack.
Definition: opt_tarjan_scc.hh:96
this class acts like a wrapper to the C code of the open_set.
Definition: public.hh:32
Definition: opt_tarjan_scc.hh:85
int transitions_cpt_
count transitions
Definition: opt_tarjan_scc.hh:126
Definition: fasttgba.hh:33
seen_map H
the HashMap Live
Definition: opt_tarjan_scc.hh:112
Definition: root_stack.hh:250
const fasttgba * a_
the automaton that will be used for the Emptiness check
Definition: opt_tarjan_scc.hh:106
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
int states_cpt_
count states
Definition: opt_tarjan_scc.hh:125
bool swarm_
shall use swarming?
Definition: opt_tarjan_scc.hh:129
Abstract class for states.
Definition: state.hh:40
std::vector< pair_state_iter > todo
the todo stack
Definition: opt_tarjan_scc.hh:93
Compute the SCCs of a TGBA.
Definition: opt_tarjan_scc.hh:40
Definition: ec.hh:71
const instance_automaton * inst
The instance automaton.
Definition: opt_tarjan_scc.hh:118
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:46
int trivial_scc_
count trivial SCCs
Definition: opt_tarjan_scc.hh:128
unsigned int max_dfs_size_
keep peack size
Definition: opt_tarjan_scc.hh:122
A simple wrapper for an automaton.
Definition: ec.hh:40
deadstore * deadstore_
The store for Deads states.
Definition: opt_tarjan_scc.hh:115
int memory_cost_
evaluates memory
Definition: opt_tarjan_scc.hh:127
int update_cpt_
count UPDATE calls
Definition: opt_tarjan_scc.hh:123
unsigned int max_live_size_
keep peack size
Definition: opt_tarjan_scc.hh:121
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:120
int tid_
the thread id
Definition: opt_tarjan_scc.hh:130
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< const spot::fasttgba_state * > live
The live stack.
Definition: opt_tarjan_scc.hh:109
color
The color for a new State.
Definition: opt_tarjan_scc.hh:82
int roots_poped_cpt_
count UPDATE loop iterations
Definition: opt_tarjan_scc.hh:124
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:137

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