spot  1.99.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
taproduct.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2012, 2013, 2014 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 #pragma once
21 
22 #include "ta.hh"
23 #include "kripke/kripke.hh"
24 
25 namespace spot
26 {
27 
33  class SPOT_API state_ta_product : public state
34  {
35  public:
39  state_ta_product(state* ta_state, state* kripke_state) :
40  ta_state_(ta_state), kripke_state_(kripke_state)
41  {
42  }
43 
46 
47  virtual
49 
50  state*
51  get_ta_state() const
52  {
53  return ta_state_;
54  }
55 
56  state*
57  get_kripke_state() const
58  {
59  return kripke_state_;
60  }
61 
62  virtual int
63  compare(const state* other) const;
64  virtual size_t
65  hash() const;
66  virtual state_ta_product*
67  clone() const;
68 
69  private:
70  state* ta_state_;
71  state* kripke_state_;
72  };
73 
76  {
77  public:
78  ta_succ_iterator_product(const state_ta_product* s, const ta* t,
79  const kripke* k);
80 
81  virtual
83 
84  // iteration
85  bool first();
86  bool next();
87  bool done() const;
88 
89  // inspection
91  current_state() const;
92  bdd
93  current_condition() const;
94 
96  current_acceptance_conditions() const;
97 
99  bool
100  is_stuttering_transition() const;
101 
102  protected:
104  void step_();
106  bool next_non_stuttering_();
107 
109  void
110  next_kripke_dest();
111 
113 
114  protected:
115  const state_ta_product* source_;
116  const ta* ta_;
117  const kripke* kripke_;
118  ta_succ_iterator* ta_succ_it_;
119  twa_succ_iterator* kripke_succ_it_;
120  state_ta_product* current_state_;
121  bdd current_condition_;
122  acc_cond::mark_t current_acceptance_conditions_;
123  bool is_stuttering_transition_;
124  bdd kripke_source_condition;
125  state * kripke_current_dest_state;
126 
127  };
128 
132  class SPOT_API ta_product: public ta
133  {
134  public:
138  ta_product(const const_ta_ptr& testing_automaton,
139  const const_kripke_ptr& kripke_structure);
140 
141  virtual
142  ~ta_product();
143 
144  virtual const std::set<state*, state_ptr_less_than>
145  get_initial_states_set() const;
146 
147  virtual ta_succ_iterator_product*
148  succ_iter(const spot::state* s) const;
149 
150  virtual ta_succ_iterator_product*
151  succ_iter(const spot::state* s, bdd changeset) const;
152 
153  virtual bdd_dict_ptr
154  get_dict() const;
155 
156  virtual std::string
157  format_state(const spot::state* s) const;
158 
159  virtual bool
160  is_accepting_state(const spot::state* s) const;
161 
162  virtual bool
163  is_livelock_accepting_state(const spot::state* s) const;
164 
165  virtual bool
166  is_initial_state(const spot::state* s) const;
167 
170  virtual bool
171  is_hole_state_in_ta_component(const spot::state* s) const;
172 
173  virtual bdd
174  get_state_condition(const spot::state* s) const;
175 
176  virtual void
177  free_state(const spot::state* s) const;
178 
179  const const_ta_ptr&
180  get_ta() const
181  {
182  return ta_;
183  }
184 
185  const const_kripke_ptr&
186  get_kripke() const
187  {
188  return kripke_;
189  }
190 
191  private:
192  bdd_dict_ptr dict_;
193  const_ta_ptr ta_;
194  const_kripke_ptr kripke_;
195 
196  // Disallow copy.
197  ta_product(const ta_product&) SPOT_DELETED;
198  ta_product& operator=(const ta_product&) SPOT_DELETED;
199  };
200 
201 
202  typedef std::shared_ptr<ta_product> ta_product_ptr;
203  typedef std::shared_ptr<const ta_product> const_ta_product_ptr;
204  inline ta_product_ptr product(const const_ta_ptr& testing_automaton,
205  const const_kripke_ptr& kripke_structure)
206  {
207  return std::make_shared<ta_product>(testing_automaton, kripke_structure);
208  }
209 
212  {
213  public:
215  const ta* t, const kripke* k,
216  bdd changeset);
217 
219  void next_kripke_dest();
220  };
221 }
Definition: graph.hh:31
A lazy product between a Testing automaton and a Kripke structure. (States are computed on the fly...
Definition: taproduct.hh:132
Interface for a Kripke structure.
Definition: kripke.hh:91
Abstract class for states.
Definition: twa.hh:42
Iterate over the successors of a state.
Definition: twa.hh:331
Iterate over the successors of a product computed on the fly.
Definition: taproduct.hh:75
A Testing Automaton.
Definition: ta.hh:75
state_ta_product(state *ta_state, state *kripke_state)
Constructor.
Definition: taproduct.hh:39
A state for spot::ta_product.
Definition: taproduct.hh:33
Iterate over the successors of a state.
Definition: ta.hh:196
Definition: acc.hh:34

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu Oct 1 2015 05:49:14 for spot by doxygen 1.8.8