spot 2.3.4

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

- File List

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
twaproduct.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2013, 2014, 2015, 2016 Laboratoire de Recherche
3 // et Développement de l'Epita (LRDE).
4 // Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris
5 // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
6 // Université Pierre 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 <spot/twa/twa.hh>
26 #include <spot/misc/fixpool.hh>
27
28 namespace spot
29 {
30
36 class SPOT_API state_product final: public state
37 {
38 public:
45 state_product(const state* left,
46 const state* right,
47 fixed_size_pool* pool)
48 : left_(left), right_(right), count_(1), pool_(pool)
49 {
50 }
51
52 virtual void destroy() const override;
53
54 const state*
55 left() const
56 {
57 return left_;
58 }
59
60 const state*
61 right() const
62 {
63 return right_;
64 }
65
66 virtual int compare(const state* other) const override;
67 virtual size_t hash() const override;
68 virtual state_product* clone() const override;
69
70 private:
71 const state* left_;
72 const state* right_;
73 mutable unsigned count_;
74 fixed_size_pool* pool_;
75
76 virtual ~state_product();
77 state_product(const state_product& o) = delete;
78 };
79
80
82 class SPOT_API twa_product: public twa
83 {
84 public:
89 twa_product(const const_twa_ptr& left, const const_twa_ptr& right);
90
91 virtual ~twa_product();
92
93 virtual const state* get_init_state() const override;
94
95 virtual twa_succ_iterator*
96 succ_iter(const state* state) const override;
97
98 virtual std::string format_state(const state* state) const override;
99
100 virtual state* project_state(const state* s, const const_twa_ptr& t)
101 const override;
102
103 const acc_cond& left_acc() const;
104 const acc_cond& right_acc() const;
105
106 protected:
107 const_twa_ptr left_;
108 const_twa_ptr right_;
109 bool left_kripke_;
110 fixed_size_pool pool_;
111
112 private:
113 // Disallow copy.
114 twa_product(const twa_product&) = delete;
115 twa_product& operator=(const twa_product&) = delete;
116 };
117
119 class SPOT_API twa_product_init final: public twa_product
120 {
121 public:
122 twa_product_init(const const_twa_ptr& left, const const_twa_ptr& right,
123 const state* left_init, const state* right_init);
124 virtual const state* get_init_state() const override;
125 protected:
126 const state* left_init_;
127 const state* right_init_;
128 };
129
131 inline twa_product_ptr otf_product(const const_twa_ptr& left,
132 const const_twa_ptr& right)
133 {
134 return std::make_shared<twa_product>(left, right);
135 }
136
138 inline twa_product_ptr otf_product_at(const const_twa_ptr& left,
139 const const_twa_ptr& right,
140 const state* left_init,
141 const state* right_init)
142 {
143 return std::make_shared<twa_product_init>(left, right,
144 left_init, right_init);
145 }
146 }
spot
Definition: graph.hh:33
spot::twa_product
A lazy product. (States are computed on the fly.)
Definition: twaproduct.hh:82
spot::twa
A Transition-based ω-Automaton.
Definition: twa.hh:622
spot::state
Abstract class for states.
Definition: twa.hh:50
spot::twa_product_init
A lazy product with different initial states.
Definition: twaproduct.hh:119
spot::twa_succ_iterator
Iterate over the successors of a state.
Definition: twa.hh:397
spot::acc_cond
Definition: acc.hh:31
spot::state_product
A state for spot::twa_product.
Definition: twaproduct.hh:36
spot::state_product::state_product
state_product(const state *left, const state *right, fixed_size_pool *pool)
Constructor.
Definition: twaproduct.hh:45
spot::fixed_size_pool
A fixed-size memory pool implementation.
Definition: fixpool.hh:31

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.