spot  1.0
taexplicit.hh
Go to the documentation of this file.
1 // Copyright (C) 2010, 2011, 2012 Laboratoire de Recherche et
2 // Developpement de l Epita_explicit (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 MERCHANta_explicitBILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 // License for more deta_explicitils.
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_TA_TAEXPLICIT_HH
20 # define SPOT_TA_TAEXPLICIT_HH
21 
22 #include "misc/hash.hh"
23 #include <list>
24 #include "tgba/tgba.hh"
25 #include <set>
26 #include "ltlast/formula.hh"
27 #include <cassert>
28 #include "misc/bddlt.hh"
29 #include "ta.hh"
30 
31 namespace spot
32 {
33  // Forward declarations. See below.
34  class state_ta_explicit;
35  class ta_explicit_succ_iterator;
36  class ta_explicit;
37 
40  class ta_explicit : public ta
41  {
42  public:
44  state_ta_explicit* artificial_initial_state = 0,
45  bool own_tgba = false);
46 
47  const tgba*
48  get_tgba() const;
49 
52 
53  void
54  add_to_initial_states_set(state* s, bdd condition = bddfalse);
55 
56  void
57  create_transition(state_ta_explicit* source, bdd condition,
58  bdd acceptance_conditions, state_ta_explicit* dest,
59  bool add_at_beginning = false);
60 
61  void
63  // ta interface
64  virtual
65  ~ta_explicit();
66  virtual const states_set_t
67  get_initial_states_set() const;
68 
69  virtual ta_succ_iterator*
70  succ_iter(const spot::state* s) const;
71 
72  virtual ta_succ_iterator*
73  succ_iter(const spot::state* s, bdd condition) const;
74 
75  virtual bdd_dict*
76  get_dict() const;
77 
78  virtual std::string
79  format_state(const spot::state* s) const;
80 
81  virtual bool
82  is_accepting_state(const spot::state* s) const;
83 
84  virtual bool
86 
87  virtual bool
88  is_initial_state(const spot::state* s) const;
89 
90  virtual bdd
91  get_state_condition(const spot::state* s) const;
92 
93  virtual void
94  free_state(const spot::state* s) const;
95 
98  {
100  }
101 
102  void
104  {
106 
107  }
108 
109  virtual void
111 
114  {
115  return states_set_;
116  }
117 
126  bdd
128  {
130  }
131 
132  private:
133  // Disallow copy.
134  ta_explicit(const ta_explicit& other);
135  ta_explicit&
136  operator=(const ta_explicit& other);
137 
138  const tgba* tgba_;
143  bool own_tgba_;
144  };
145 
149  {
150 #ifndef SWIG
151  public:
152 
154  struct transition
155  {
159  };
160 
161  typedef std::list<transition*> transitions;
162 
163  state_ta_explicit(const state* tgba_state, const bdd tgba_condition,
164  bool is_initial_state = false, bool is_accepting_state = false,
165  bool is_livelock_accepting_state = false, transitions* trans = 0) :
166  tgba_state_(tgba_state), tgba_condition_(tgba_condition),
170  {
171  }
172 
173  virtual int
174  compare(const spot::state* other) const;
175  virtual size_t
176  hash() const;
177  virtual state_ta_explicit*
178  clone() const;
179 
180  virtual void
181  destroy() const
182  {
183  }
184 
185  virtual
187  {
188  }
189 
190  transitions*
191  get_transitions() const;
192 
193  // return transitions filtred by condition
194  transitions*
195  get_transitions(bdd condition) const;
196 
197  void
198  add_transition(transition* t, bool add_at_beginning = false);
199 
200  const state*
201  get_tgba_state() const;
202  const bdd
203  get_tgba_condition() const;
204  bool
205  is_accepting_state() const;
206  void
208  bool
210  void
212 
213  bool
214  is_initial_state() const;
215  void
217 
219  bool
220  is_hole_state() const;
221 
224  void
226 
227  void
229 
231  private:
233  const bdd tgba_condition_;
238  Sgi::hash_map<int, transitions*, Sgi::hash<int> > transitions_by_condition;
239 #endif // !SWIG
240  };
241 
244  {
245  public:
247 
248  ta_explicit_succ_iterator(const state_ta_explicit* s, bdd condition);
249 
250  virtual void
251  first();
252  virtual void
253  next();
254  virtual bool
255  done() const;
256 
257  virtual state*
258  current_state() const;
259  virtual bdd
260  current_condition() const;
261 
262  virtual bdd
264 
265  private:
267  state_ta_explicit::transitions::const_iterator i_;
269  };
270 
271 }
272 
273 #endif // SPOT_TA_TAEXPLICIT_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Sat Oct 27 2012 09:34:32 for spot by doxygen 1.8.1.2