spot 2.11.0.dev
twaproduct.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) 2011, 2013, 2014, 2015, 2016, 2019 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
28namespace 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,
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_;
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_;
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 SPOT_make_shared_enabled__(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 SPOT_make_shared_enabled__(twa_product_init,
144 left, right, left_init, right_init);
145 }
146}
An acceptance condition.
Definition: acc.hh:62
A state for spot::twa_product.
Definition: twaproduct.hh:37
virtual size_t hash() const override
Hash a state.
virtual void destroy() const override
Release a state.
state_product(const state *left, const state *right, fixed_size_pool< pool_type::Safe > *pool)
Constructor.
Definition: twaproduct.hh:45
virtual int compare(const state *other) const override
Compares two states (that come from the same automaton).
virtual state_product * clone() const override
Duplicate a state.
Abstract class for states.
Definition: twa.hh:51
A lazy product with different initial states.
Definition: twaproduct.hh:120
virtual const state * get_init_state() const override
Get the initial state of the automaton.
A lazy product. (States are computed on the fly.)
Definition: twaproduct.hh:83
virtual std::string format_state(const state *state) const override
Format the state as a string for printing.
twa_product(const const_twa_ptr &left, const const_twa_ptr &right)
Constructor.
virtual twa_succ_iterator * succ_iter(const state *state) const override
Get an iterator over the successors of local_state.
virtual state * project_state(const state *s, const const_twa_ptr &t) const override
Project a state on an automaton.
virtual const state * get_init_state() const override
Get the initial state of the automaton.
Iterate over the successors of a state.
Definition: twa.hh:398
A Transition-based ω-Automaton.
Definition: twa.hh:623
Definition: automata.hh:27
twa_product_ptr otf_product(const const_twa_ptr &left, const const_twa_ptr &right)
on-the-fly TGBA product
Definition: twaproduct.hh:131
twa_product_ptr otf_product_at(const const_twa_ptr &left, const const_twa_ptr &right, const state *left_init, const state *right_init)
on-the-fly TGBA product with forced initial states
Definition: twaproduct.hh:138

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.4