spot  1.99.7
twaproduct.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
3 // 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;
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;
67  virtual size_t hash() const;
68  virtual state_product* clone() const;
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); // No implementation.
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;
94 
95  virtual twa_succ_iterator*
96  succ_iter(const state* state) const;
97 
98  virtual std::string format_state(const state* state) const;
99 
100  virtual std::string
101  transition_annotation(const twa_succ_iterator* t) const;
102 
103  virtual state* project_state(const state* s, const const_twa_ptr& t) const;
104 
105  const acc_cond& left_acc() const;
106  const acc_cond& right_acc() const;
107 
108  protected:
109  virtual bdd compute_support_conditions(const state* state) const;
110 
111  protected:
112  const_twa_ptr left_;
113  const_twa_ptr right_;
114  bool left_kripke_;
115  fixed_size_pool pool_;
116 
117  private:
118  // Disallow copy.
119  twa_product(const twa_product&) = delete;
120  twa_product& operator=(const twa_product&) = delete;
121  };
122 
124  class SPOT_API twa_product_init final: public twa_product
125  {
126  public:
127  twa_product_init(const const_twa_ptr& left, const const_twa_ptr& right,
128  const state* left_init, const state* right_init);
129  virtual const state* get_init_state() const;
130  protected:
131  const state* left_init_;
132  const state* right_init_;
133  };
134 
136  inline twa_product_ptr otf_product(const const_twa_ptr& left,
137  const const_twa_ptr& right)
138  {
139  return std::make_shared<twa_product>(left, right);
140  }
141 
143  inline twa_product_ptr otf_product_at(const const_twa_ptr& left,
144  const const_twa_ptr& right,
145  const state* left_init,
146  const state* right_init)
147  {
148  return std::make_shared<twa_product_init>(left, right,
149  left_init, right_init);
150  }
151 }
Definition: graph.hh:32
A lazy product. (States are computed on the fly.)
Definition: twaproduct.hh:82
A Transition-based ω-Automaton.
Definition: twa.hh:483
Abstract class for states.
Definition: twa.hh:43
A lazy product with different initial states.
Definition: twaproduct.hh:124
Iterate over the successors of a state.
Definition: twa.hh:332
Definition: acc.hh:31
A state for spot::twa_product.
Definition: twaproduct.hh:36
state_product(const state *left, const state *right, fixed_size_pool *pool)
Constructor.
Definition: twaproduct.hh:45
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.
Generated on Fri Jan 15 2016 13:01:50 for spot by doxygen 1.8.9.1