spot  1.0.1
taexplicit.hh
Go to the documentation of this file.
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et
3 // 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 #ifndef SPOT_TA_TAEXPLICIT_HH
21 # define SPOT_TA_TAEXPLICIT_HH
22 
23 #include "misc/hash.hh"
24 #include <list>
25 #include "tgba/tgba.hh"
26 #include <set>
27 #include "ltlast/formula.hh"
28 #include <cassert>
29 #include "misc/bddlt.hh"
30 #include "ta.hh"
31 
32 namespace spot
33 {
34  // Forward declarations. See below.
35  class state_ta_explicit;
36  class ta_explicit_succ_iterator;
37  class ta_explicit;
38 
41  class ta_explicit : public ta
42  {
43  public:
45  state_ta_explicit* artificial_initial_state = 0,
46  bool own_tgba = false);
47 
48  const tgba*
49  get_tgba() const;
50 
53 
54  void
55  add_to_initial_states_set(state* s, bdd condition = bddfalse);
56 
57  void
58  create_transition(state_ta_explicit* source, bdd condition,
59  bdd acceptance_conditions, state_ta_explicit* dest,
60  bool add_at_beginning = false);
61 
62  void
64  // ta interface
65  virtual
66  ~ta_explicit();
67  virtual const states_set_t
68  get_initial_states_set() const;
69 
70  virtual ta_succ_iterator*
71  succ_iter(const spot::state* s) const;
72 
73  virtual ta_succ_iterator*
74  succ_iter(const spot::state* s, bdd condition) const;
75 
76  virtual bdd_dict*
77  get_dict() const;
78 
79  virtual std::string
80  format_state(const spot::state* s) const;
81 
82  virtual bool
83  is_accepting_state(const spot::state* s) const;
84 
85  virtual bool
87 
88  virtual bool
89  is_initial_state(const spot::state* s) const;
90 
91  virtual bdd
92  get_state_condition(const spot::state* s) const;
93 
94  virtual void
95  free_state(const spot::state* s) const;
96 
99  {
101  }
102 
103  void
105  {
107 
108  }
109 
110  virtual void
112 
115  {
116  return states_set_;
117  }
118 
127  bdd
129  {
131  }
132 
133  private:
134  // Disallow copy.
135  ta_explicit(const ta_explicit& other);
136  ta_explicit&
137  operator=(const ta_explicit& other);
138 
139  const tgba* tgba_;
144  bool own_tgba_;
145  };
146 
150  {
151 #ifndef SWIG
152  public:
153 
155  struct transition
156  {
160  };
161 
162  typedef std::list<transition*> transitions;
163 
164  state_ta_explicit(const state* tgba_state, const bdd tgba_condition,
165  bool is_initial_state = false, bool is_accepting_state = false,
166  bool is_livelock_accepting_state = false, transitions* trans = 0) :
167  tgba_state_(tgba_state), tgba_condition_(tgba_condition),
171  {
172  }
173 
174  virtual int
175  compare(const spot::state* other) const;
176  virtual size_t
177  hash() const;
178  virtual state_ta_explicit*
179  clone() const;
180 
181  virtual void
182  destroy() const
183  {
184  }
185 
186  virtual
188  {
189  }
190 
191  transitions*
192  get_transitions() const;
193 
194  // return transitions filtred by condition
195  transitions*
196  get_transitions(bdd condition) const;
197 
198  void
199  add_transition(transition* t, bool add_at_beginning = false);
200 
201  const state*
202  get_tgba_state() const;
203  const bdd
204  get_tgba_condition() const;
205  bool
206  is_accepting_state() const;
207  void
209  bool
211  void
213 
214  bool
215  is_initial_state() const;
216  void
218 
220  bool
221  is_hole_state() const;
222 
225  void
227 
228  void
230 
232  private:
234  const bdd tgba_condition_;
239  Sgi::hash_map<int, transitions*, Sgi::hash<int> > transitions_by_condition;
240 #endif // !SWIG
241  };
242 
245  {
246  public:
248 
249  ta_explicit_succ_iterator(const state_ta_explicit* s, bdd condition);
250 
251  virtual void
252  first();
253  virtual void
254  next();
255  virtual bool
256  done() const;
257 
258  virtual state*
259  current_state() const;
260  virtual bdd
261  current_condition() const;
262 
263  virtual bdd
265 
266  private:
268  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 Wed Jan 23 2013 15:00:01 for spot by doxygen 1.8.1.2