spot 2.2.2

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

- File List

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
emptiness.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2013, 2014, 2015, 2016 Laboratoire de Recherche et
3 // Developpement de l'Epita (LRDE).
4 // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
5 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
6 // et Marie Curie.
7 //
8 // This file is part of Spot, a model checking library.
9 //
10 // Spot is free software; you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Spot is distributed in the hope that it will be useful, but WITHOUT
16 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 // License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23 #pragma once
24
25 #include <map>
26 #include <list>
27 #include <iosfwd>
28 #include <bddx.h>
29 #include <spot/misc/optionmap.hh>
30 #include <spot/twa/twagraph.hh>
31 #include <spot/twaalgos/emptiness_stats.hh>
32
33 namespace spot
34 {
35 struct twa_run;
36 typedef std::shared_ptr<twa_run> twa_run_ptr;
37 typedef std::shared_ptr<const twa_run> const_twa_run_ptr;
38
78
84 class SPOT_API emptiness_check_result
85 {
86 public:
87 emptiness_check_result(const const_twa_ptr& a,
88 option_map o = option_map())
89 : a_(a), o_(o)
90 {
91 }
92
93 virtual
94 ~emptiness_check_result()
95 {
96 }
97
110 virtual twa_run_ptr accepting_run();
111
113 const const_twa_ptr&
114 automaton() const
115 {
116 return a_;
117 }
118
120 const option_map&
121 options() const
122 {
123 return o_;
124 }
125
127 const char* parse_options(char* options);
128
130 virtual const unsigned_statistics* statistics() const;
131
132 protected:
134 virtual void options_updated(const option_map& old);
135
136 const_twa_ptr a_;
137 option_map o_;
138 };
139
140 typedef std::shared_ptr<emptiness_check_result> emptiness_check_result_ptr;
141
143 class SPOT_API emptiness_check:
144 public std::enable_shared_from_this<emptiness_check>
145 {
146 public:
147 emptiness_check(const const_twa_ptr& a, option_map o = option_map())
148 : a_(a), o_(o)
149 {
150 }
151 virtual ~emptiness_check();
152
154 const const_twa_ptr&
155 automaton() const
156 {
157 return a_;
158 }
159
161 const option_map&
162 options() const
163 {
164 return o_;
165 }
166
168 const char* parse_options(char* options);
169
171 virtual bool safe() const;
172
187 virtual emptiness_check_result_ptr check() = 0;
188
190 virtual const unsigned_statistics* statistics() const;
191
193 virtual const ec_statistics* emptiness_check_statistics() const;
194
196 virtual std::ostream& print_stats(std::ostream& os) const;
197
199 virtual void options_updated(const option_map& old);
200
201 protected:
202 const_twa_ptr a_;
203 option_map o_;
204 };
205
206 typedef std::shared_ptr<emptiness_check> emptiness_check_ptr;
207
208 class emptiness_check_instantiator;
209 typedef std::shared_ptr<emptiness_check_instantiator>
210 emptiness_check_instantiator_ptr;
211
213 class SPOT_API emptiness_check_instantiator
214 {
215 public:
217 emptiness_check_ptr instantiate(const const_twa_ptr& a) const;
218
221 const option_map&
222 options() const
223 {
224 return o_;
225 }
226
227 option_map&
228 options()
229 {
230 return o_;
231 }
233
236 unsigned int min_sets() const;
237
242 unsigned int max_sets() const;
243 protected:
244 emptiness_check_instantiator(option_map o, void* i);
245
246 option_map o_;
247 void *info_;
248 };
249
361 SPOT_API emptiness_check_instantiator_ptr
362 make_emptiness_check_instantiator(const char* name, const char** err);
363
365
366
369
373
375 struct SPOT_API twa_run final
376 {
377 struct step {
378 const state* s;
379 bdd label;
380 acc_cond::mark_t acc;
381
382 step(const state* s, bdd label, acc_cond::mark_t acc)
383 : s(s), label(label), acc(acc)
384 {
385 }
386 step()
387 {
388 }
389 };
390
391 typedef std::list<step> steps;
392
393 steps prefix;
394 steps cycle;
395 const_twa_ptr aut;
396
397 ~twa_run();
398 twa_run(const const_twa_ptr& aut)
399 : aut(aut)
400 {
401 }
402 twa_run(const twa_run& run);
403 twa_run& operator=(const twa_run& run);
404
409 twa_run_ptr reduce() const;
410
419 twa_run_ptr project(const const_twa_ptr& other, bool right = false);
420
431 bool replay(std::ostream& os, bool debug = false) const;
432
436 void highlight(unsigned color);
437
441 twa_graph_ptr as_twa() const;
442
457 SPOT_API
458 friend std::ostream& operator<<(std::ostream& os, const twa_run& run);
459 };
461
464 }
spot
Definition: graph.hh:32
spot::twa_run::step
Definition: emptiness.hh:377
spot::ec_statistics
Emptiness-check statistics.
Definition: emptiness_stats.hh:121
spot::emptiness_check
Common interface to emptiness check algorithms.
Definition: emptiness.hh:143
spot::option_map
Manage a map of options.
Definition: optionmap.hh:37
spot::state
Abstract class for states.
Definition: twa.hh:50
spot::emptiness_check_instantiator
Dynamically create emptiness checks. Given their name and options.
Definition: emptiness.hh:213
spot::emptiness_check_result::o_
option_map o_
The options.
Definition: emptiness.hh:137
spot::make_emptiness_check_instantiator
emptiness_check_instantiator_ptr make_emptiness_check_instantiator(const char *name, const char **err)
Create an emptiness-check instantiator, given the name of an emptiness check.
spot::twa_run
An accepted run, for a twa.
Definition: emptiness.hh:375
spot::emptiness_check::automaton
const const_twa_ptr & automaton() const
The automaton that this emptiness-check inspects.
Definition: emptiness.hh:155
spot::emptiness_check_result::automaton
const const_twa_ptr & automaton() const
The automaton on which an accepting_run() was found.
Definition: emptiness.hh:114
spot::emptiness_check_result::a_
const_twa_ptr a_
The automaton.
Definition: emptiness.hh:136
spot::emptiness_check_result
The result of an emptiness check.
Definition: emptiness.hh:84
spot::unsigned_statistics
Definition: emptiness_stats.hh:35
spot::emptiness_check::o_
option_map o_
The options.
Definition: emptiness.hh:203
spot::emptiness_check_result::options
const option_map & options() const
Return the options parametrizing how the accepting run is computed.
Definition: emptiness.hh:121
spot::emptiness_check::options
const option_map & options() const
Return the options parametrizing how the emptiness check is realized.
Definition: emptiness.hh:162
spot::emptiness_check::a_
const_twa_ptr a_
The automaton.
Definition: emptiness.hh:202
spot::emptiness_check_instantiator::options
option_map & options()
Definition: emptiness.hh:228
spot::emptiness_check_instantiator::options
const option_map & options() const
Definition: emptiness.hh:222
spot::acc_cond::mark_t
Definition: acc.hh:34

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