spot 2.3.3

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
reachiter.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016 Laboratoire de
3 // Recherche et Développement de l'Epita (LRDE).
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 #pragma once
21
22 #include <spot/misc/hash.hh>
23 #include <spot/ta/ta.hh>
24 #include <stack>
25 #include <deque>
26
27 namespace spot
28 {
31 class SPOT_API ta_reachable_iterator
32 {
33 public:
34 ta_reachable_iterator(const const_ta_ptr& a);
35 virtual
36 ~ta_reachable_iterator();
37
43 void
44 run();
45
53 virtual void
54 add_state(const state* s) = 0;
56 virtual const state*
57 next_state() = 0;
59
62 virtual bool
63 want_state(const state* s) const;
64
66 virtual void
67 start();
69 virtual void
70 end();
71
76 virtual void
77 process_state(const state* s, int n);
84 virtual void
85 process_link(int in, int out, const ta_succ_iterator* si);
86
87 protected:
88
89 const_ta_ptr t_automata_;
90
91 state_map<int> seen;
92 };
93
97 class SPOT_API ta_reachable_iterator_depth_first
98 : public ta_reachable_iterator
99 {
100 public:
101 ta_reachable_iterator_depth_first(const const_ta_ptr& a);
102
103 virtual void add_state(const state* s) override;
104 virtual const state* next_state() override;
105
106 protected:
107 std::stack<const state*> todo;
108 };
109
113 class SPOT_API ta_reachable_iterator_breadth_first
114 : public ta_reachable_iterator
115 {
116 public:
117 ta_reachable_iterator_breadth_first(const const_ta_ptr& a);
118
119 virtual void add_state(const state* s) override;
120 virtual const state* next_state() override;
121
122 protected:
123 std::deque<const state*> todo;
124 };
125 }
spot
Definition: graph.hh:33
spot::ta_reachable_iterator_depth_first::todo
std::stack< const state * > todo
A stack of states yet to explore.
Definition: reachiter.hh:107
spot::ta_reachable_iterator
Iterate over all reachable states of a spot::ta.
Definition: reachiter.hh:31
spot::ta_reachable_iterator_depth_first
An implementation of spot::ta_reachable_iterator that browses states depth first. ...
Definition: reachiter.hh:97
spot::state
Abstract class for states.
Definition: twa.hh:50
spot::ta_reachable_iterator_breadth_first
An implementation of spot::ta_reachable_iterator that browses states breadth first.
Definition: reachiter.hh:113
spot::ta_reachable_iterator::seen
state_map< int > seen
States already seen.
Definition: reachiter.hh:91
spot::ta_reachable_iterator_breadth_first::todo
std::deque< const state * > todo
A queue of states yet to explore.
Definition: reachiter.hh:123
spot::ta_succ_iterator
Iterate over the successors of a state.
Definition: ta.hh:197
spot::ta_reachable_iterator::t_automata_
const_ta_ptr t_automata_
The spot::ta to explore.
Definition: reachiter.hh:89

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.