spot 2.3.4

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

- File List

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