spot  1.99.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
emptiness.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2013, 2014, 2015 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 "misc/optionmap.hh"
30 #include "twa/twagraph.hh"
31 #include "emptiness_stats.hh"
32 
33 namespace spot
34 {
35  struct tgba_run;
36  typedef std::shared_ptr<tgba_run> tgba_run_ptr;
37  typedef std::shared_ptr<const tgba_run> const_tgba_run_ptr;
38 
71 
77  class SPOT_API emptiness_check_result
78  {
79  public:
80  emptiness_check_result(const const_twa_ptr& a,
81  option_map o = option_map())
82  : a_(a), o_(o)
83  {
84  }
85 
86  virtual
88  {
89  }
90 
103  virtual tgba_run_ptr accepting_run();
104 
106  const const_twa_ptr&
107  automaton() const
108  {
109  return a_;
110  }
111 
113  const option_map&
114  options() const
115  {
116  return o_;
117  }
118 
120  const char* parse_options(char* options);
121 
123  virtual const unsigned_statistics* statistics() const;
124 
125  protected:
127  virtual void options_updated(const option_map& old);
128 
129  const_twa_ptr a_;
131  };
132 
133  typedef std::shared_ptr<emptiness_check_result> emptiness_check_result_ptr;
134 
136  class SPOT_API emptiness_check:
137  public std::enable_shared_from_this<emptiness_check>
138  {
139  public:
140  emptiness_check(const const_twa_ptr& a, option_map o = option_map())
141  : a_(a), o_(o)
142  {
143  }
144  virtual ~emptiness_check();
145 
147  const const_twa_ptr&
148  automaton() const
149  {
150  return a_;
151  }
152 
154  const option_map&
155  options() const
156  {
157  return o_;
158  }
159 
161  const char* parse_options(char* options);
162 
164  virtual bool safe() const;
165 
180  virtual emptiness_check_result_ptr check() = 0;
181 
183  virtual const unsigned_statistics* statistics() const;
184 
186  virtual const ec_statistics* emptiness_check_statistics() const;
187 
189  virtual std::ostream& print_stats(std::ostream& os) const;
190 
192  virtual void options_updated(const option_map& old);
193 
194  protected:
195  const_twa_ptr a_;
197  };
198 
199  typedef std::shared_ptr<emptiness_check> emptiness_check_ptr;
200 
202  typedef std::shared_ptr<emptiness_check_instantiator>
203  emptiness_check_instantiator_ptr;
204 
205  // Dynamically create emptiness checks. Given their name and options.
207  {
208  public:
210  emptiness_check_ptr instantiate(const const_twa_ptr& a) const;
211 
214  const option_map&
215  options() const
216  {
217  return o_;
218  }
219 
220  option_map&
221  options()
222  {
223  return o_;
224  }
226 
229  unsigned int min_acceptance_conditions() const;
230 
235  unsigned int max_acceptance_conditions() const;
236  protected:
237  emptiness_check_instantiator(option_map o, void* i);
238 
239  option_map o_;
240  void *info_;
241  };
243 
253  SPOT_API emptiness_check_instantiator_ptr
254  make_emptiness_check_instantiator(const char* name, const char** err);
255 
256 
259 
260 
264 
266  struct SPOT_API tgba_run
267  {
268  struct step {
269  const state* s;
270  bdd label;
271  acc_cond::mark_t acc;
272 
273  step(const state* s, bdd label, acc_cond::mark_t acc)
274  : s(s), label(label), acc(acc)
275  {
276  }
277  step()
278  {
279  }
280  };
281 
282  typedef std::list<step> steps;
283 
284  steps prefix;
285  steps cycle;
286 
287  ~tgba_run();
288  tgba_run()
289  {
290  };
291  tgba_run(const tgba_run& run);
292  tgba_run& operator=(const tgba_run& run);
293  };
294 
309  SPOT_API std::ostream&
310  print_tgba_run(std::ostream& os,
311  const const_twa_ptr& a,
312  const const_tgba_run_ptr& run);
313 
318  SPOT_API twa_graph_ptr
319  tgba_run_to_tgba(const const_twa_ptr& a, const const_tgba_run_ptr& run);
320 
322 
325 }
Definition: public.hh:31
Emptiness-check statistics.
Definition: emptiness_stats.hh:121
Common interface to emptiness check algorithms.
Definition: emptiness.hh:136
Manage a map of options.
Definition: optionmap.hh:36
An accepted run, for a tgba.
Definition: emptiness.hh:266
Abstract class for states.
Definition: twa.hh:40
SPOT_API std::ostream & print_tgba_run(std::ostream &os, const const_twa_ptr &a, const const_tgba_run_ptr &run)
Display a tgba_run.
Definition: emptiness.hh:206
option_map o_
The options.
Definition: emptiness.hh:130
const const_twa_ptr & automaton() const
The automaton that this emptiness-check inspects.
Definition: emptiness.hh:148
const const_twa_ptr & automaton() const
The automaton on which an accepting_run() was found.
Definition: emptiness.hh:107
const_twa_ptr a_
The automaton.
Definition: emptiness.hh:129
The result of an emptiness check.
Definition: emptiness.hh:77
Definition: emptiness_stats.hh:35
option_map o_
The options.
Definition: emptiness.hh:196
const option_map & options() const
Return the options parametrizing how the accepting run is computed.
Definition: emptiness.hh:114
Definition: emptiness.hh:268
const option_map & options() const
Return the options parametrizing how the emptiness check is realized.
Definition: emptiness.hh:155
const_twa_ptr a_
The automaton.
Definition: emptiness.hh:195
SPOT_API twa_graph_ptr tgba_run_to_tgba(const const_twa_ptr &a, const const_tgba_run_ptr &run)
Return an explicit_tgba corresponding to run (i.e. comparable states are merged). ...
const option_map & options() const
Definition: emptiness.hh:215
Definition: acc.hh:34

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Wed Aug 26 2015 08:42:37 for spot by doxygen 1.8.8