spot  1.99.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 "twa.hh"
26 #include "misc/fixpool.hh"
27 
28 namespace spot
29 {
30 
36  class SPOT_API state_product final: public state
37  {
38  public:
45  state_product(state* left, state* right, fixed_size_pool* pool)
46  : left_(left), right_(right), count_(1), pool_(pool)
47  {
48  }
49 
50  virtual void destroy() const;
51 
52  state*
53  left() const
54  {
55  return left_;
56  }
57 
58  state*
59  right() const
60  {
61  return right_;
62  }
63 
64  virtual int compare(const state* other) const;
65  virtual size_t hash() const;
66  virtual state_product* clone() const;
67 
68  private:
69  state* left_;
70  state* right_;
71  mutable unsigned count_;
72  fixed_size_pool* pool_;
73 
74  virtual ~state_product();
75  state_product(const state_product& o); // No implementation.
76  };
77 
78 
80  class SPOT_API twa_product: public twa
81  {
82  public:
87  twa_product(const const_twa_ptr& left, const const_twa_ptr& right);
88 
89  virtual ~twa_product();
90 
91  virtual state* get_init_state() const;
92 
93  virtual twa_succ_iterator*
94  succ_iter(const state* state) const;
95 
96  virtual std::string format_state(const state* state) const;
97 
98  virtual std::string
99  transition_annotation(const twa_succ_iterator* t) const;
100 
101  virtual state* project_state(const state* s, const const_twa_ptr& t) const;
102 
103  const acc_cond& left_acc() const;
104  const acc_cond& right_acc() const;
105 
106  protected:
107  virtual bdd compute_support_conditions(const state* state) const;
108 
109  protected:
110  const_twa_ptr left_;
111  const_twa_ptr right_;
112  bool left_kripke_;
113  fixed_size_pool pool_;
114 
115  private:
116  // Disallow copy.
117  twa_product(const twa_product&) SPOT_DELETED;
118  twa_product& operator=(const twa_product&) SPOT_DELETED;
119  };
120 
122  class SPOT_API twa_product_init final: public twa_product
123  {
124  public:
125  twa_product_init(const const_twa_ptr& left, const const_twa_ptr& right,
126  const state* left_init, const state* right_init);
127  virtual state* get_init_state() const;
128  protected:
129  const state* left_init_;
130  const state* right_init_;
131  };
132 
134  inline twa_product_ptr otf_product(const const_twa_ptr& left,
135  const const_twa_ptr& right)
136  {
137  return std::make_shared<twa_product>(left, right);
138  }
139 
141  inline twa_product_ptr otf_product_at(const const_twa_ptr& left,
142  const const_twa_ptr& right,
143  const state* left_init,
144  const state* right_init)
145  {
146  return std::make_shared<twa_product_init>(left, right,
147  left_init, right_init);
148  }
149 }
Definition: graph.hh:31
A lazy product. (States are computed on the fly.)
Definition: twaproduct.hh:80
state_product(state *left, state *right, fixed_size_pool *pool)
Constructor.
Definition: twaproduct.hh:45
A Transition-based ω-Automaton.
Definition: twa.hh:482
Abstract class for states.
Definition: twa.hh:42
A lazy product with different initial states.
Definition: twaproduct.hh:122
Iterate over the successors of a state.
Definition: twa.hh:331
Definition: acc.hh:31
A state for spot::twa_product.
Definition: twaproduct.hh:36
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 Thu Oct 1 2015 05:49:14 for spot by doxygen 1.8.8