spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
generic_dfs.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_GENERIC_DFS_HH
20 # define SPOT_FASTTGBAALGOS_GENERIC_DFS_HH
21 
22 #include <stack>
23 #include "misc/hash.hh"
24 #include "fasttgba/fasttgba.hh"
25 
26 namespace spot
27 {
29  {
30  public:
31  generic_dfs(const fasttgba* a);
32 
33  virtual ~generic_dfs();
34 
35  void run();
36 
37  virtual void add_state(const fasttgba_state* s);
38 
39  virtual const fasttgba_state* next_state();
40 
41  virtual bool want_state(const fasttgba_state* s) const = 0;
42 
43  virtual void start() = 0;
44 
45  virtual void end() = 0;
46 
47  virtual void process_state(const fasttgba_state* s, int n,
48  fasttgba_succ_iterator* si) = 0;
49 
50  virtual void process_link(const fasttgba_state* in_s, int in,
51  const fasttgba_state* out_s, int out,
52  const fasttgba_succ_iterator* si) = 0;
53 
54  protected:
55  const fasttgba* a_;
56 
57  std::stack<const fasttgba_state*>
58  todo;
59 
60  typedef Sgi::hash_map<const fasttgba_state*, int,
62  fasttgba_state_ptr_equal> seen_map;
63 
64  seen_map seen;
65  };
66 }
67 
68 #endif // SPOT_FASTTGBAALGOS_GENERIC_DFS_HH
Definition: fasttgba.hh:33
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
Iterate over the successors of a state.
Definition: fasttgba_succ_iterator.hh:35
Definition: fasttgba_state.hh:76
Definition: fasttgba_state.hh:88
std::stack< const fasttgba_state * > todo
A stack of states yet to explore.
Definition: generic_dfs.hh:58
Definition: generic_dfs.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