spot
1.1.3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
tgbaalgos
gtec
gtec.hh
Go to the documentation of this file.
1
// Copyright (C) 2008 Laboratoire de Recherche et Development de
2
// l'Epita (LRDE).
3
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
4
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
5
// Université Pierre et Marie Curie.
6
//
7
// This file is part of Spot, a model checking library.
8
//
9
// Spot is free software; you can redistribute it and/or modify it
10
// under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 3 of the License, or
12
// (at your option) any later version.
13
//
14
// Spot is distributed in the hope that it will be useful, but WITHOUT
15
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17
// License for more details.
18
//
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22
#ifndef SPOT_TGBAALGOS_GTEC_GTEC_HH
23
# define SPOT_TGBAALGOS_GTEC_GTEC_HH
24
25
#include <stack>
26
#include "
status.hh
"
27
#include "
tgbaalgos/emptiness.hh
"
28
#include "
tgbaalgos/emptiness_stats.hh
"
29
30
namespace
spot
31
{
34
38
55
93
emptiness_check*
139
couvreur99
(
const
tgba* a,
140
option_map options = option_map(),
141
const
numbered_state_heap_factory* nshf
142
=
numbered_state_heap_hash_map_factory::instance
());
143
144
148
class
couvreur99_check
:
public
emptiness_check
,
public
ec_statistics
149
{
150
public
:
151
couvreur99_check
(
const
tgba
* a,
152
option_map
o =
option_map
(),
153
const
numbered_state_heap_factory
* nshf
154
=
numbered_state_heap_hash_map_factory::instance
());
155
virtual
~couvreur99_check
();
156
158
virtual
emptiness_check_result
*
check
();
159
160
virtual
std::ostream&
print_stats
(std::ostream& os)
const
;
161
170
const
couvreur99_check_status
*
result
()
const
;
171
172
protected
:
173
couvreur99_check_status
*
ecs_
;
179
void
remove_component
(
const
state
* start_delete);
180
182
bool
poprem_
;
184
unsigned
removed_components
;
185
unsigned
get_removed_components
()
const
;
186
unsigned
get_vmsize
()
const
;
187
};
188
193
class
couvreur99_check_shy
:
public
couvreur99_check
194
{
195
public
:
196
couvreur99_check_shy
(
const
tgba
* a,
197
option_map
o =
option_map
(),
198
const
numbered_state_heap_factory
* nshf
199
=
numbered_state_heap_hash_map_factory::instance
());
200
virtual
~couvreur99_check_shy
();
201
202
virtual
emptiness_check_result
*
check
();
203
204
protected
:
205
struct
successor
{
206
bdd
acc
;
207
const
spot::state
*
s
;
208
successor
(bdd
acc
,
const
spot::state
*
s
): acc(acc), s(s) {}
209
};
210
211
// We use five main data in this algorithm:
212
// * couvreur99_check::root, a stack of strongly connected components (SCC),
213
// * couvreur99_check::h, a hash of all visited nodes, with their order,
214
// (it is called "Hash" in Couvreur's paper)
215
// * arc, a stack of acceptance conditions between each of these SCC,
216
std::stack<bdd>
arc
;
217
// * num, the number of visited nodes. Used to set the order of each
218
// visited node,
219
int
num
;
220
// * todo, the depth-first search stack. This holds pairs of the
221
// form (STATE, SUCCESSORS) where SUCCESSORS is a list of
222
// (ACCEPTANCE_CONDITIONS, STATE) pairs.
223
typedef
std::list<successor>
succ_queue
;
224
225
// Position in the loop seeking known successors.
226
succ_queue::iterator
pos
;
227
228
struct
todo_item
229
{
230
const
state
*
s
;
231
int
n
;
232
succ_queue
q
;
// Unprocessed successors of S
233
todo_item
(
const
state
*
s
,
int
n
,
couvreur99_check_shy
* shy);
234
};
235
236
typedef
std::list<todo_item>
todo_list
;
237
todo_list
todo
;
238
239
void
clear_todo
();
240
242
void
dump_queue
(std::ostream& os = std::cerr);
243
245
bool
group_
;
246
// If the "group2" option is set (it implies "group"), we
247
// reprocess the successor states of SCC that have been merged.
248
bool
group2_
;
249
// If the onepass option is true, do only one pass. This cancels
250
// all the "shyness" of the algorithm, but we need the framework
251
// of the implementation when working with GreatSPN.
252
bool
onepass_
;
253
262
virtual
numbered_state_heap::state_index_p
find_state
(
const
state
* s);
263
};
264
265
267
}
268
269
#endif // SPOT_TGBAALGOS_GTEC_GTEC_HH
Please direct any
question
,
comment
, or
bug report
to the Spot mailing list at
spot@lrde.epita.fr
.
Generated on Tue Jul 9 2013 14:04:33 for spot by
1.8.4