spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fasttgba_product.hh
1 // Copyright (C) 2012 Laboratoire de Recherche et Développement
2 // de l'Epita (LRDE).
3 //
4 // This file is part of Spot, a model checking library.
5 //
6 // Spot is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // Spot is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef SPOT_FASTTGBA_FASTTGBA_PRODUCT_HH
20 # define SPOT_FASTTGBA_FASTTGBA_PRODUCT_HH
21 
22 #include <list>
23 #include "fasttgba.hh"
24 #include "misc/hash.hh"
25 #include "misc/fixpool.hh"
26 
27 namespace spot
28 {
35  {
36  public:
37  // ------------------------------------------------------------
38  // Fast tgba state interface
39  // ------------------------------------------------------------
41  const fasttgba_state* right,
42  fixed_size_pool* p);
43  virtual int compare(const fasttgba_state* other) const;
44  virtual size_t hash() const;
45  virtual fasttgba_state* clone() const;
46  virtual void* external_information() const;
47  virtual void destroy() const;
48 
50  virtual const fasttgba_state* left() const;
51 
53  virtual const fasttgba_state* right() const;
54 
55  private:
56  const fasttgba_state* left_;
57  const fasttgba_state* right_;
58  mutable int count_;
59  fixed_size_pool* pool_;
60  };
61 
77  {
78  public:
79  // ------------------------------------------------------------
80  // Fast tgba succ iterator interface
81  // ------------------------------------------------------------
84  fixed_size_pool* p,
85  bool left_is_kripke = false);
86  virtual ~fast_product_iterator();
87  virtual void first();
88  virtual void next();
89  virtual bool done() const;
90  virtual fasttgba_state* current_state() const;
91  virtual cube current_condition() const;
92  virtual markset current_acceptance_marks() const;
93 
95  virtual fasttgba_succ_iterator* left() const;
96 
98  virtual fasttgba_succ_iterator* right() const;
99 
100  protected:
103  void step();
104 
107  fixed_size_pool* pool_;
108  bool kripke_left;
109  };
110 
111 
124  class SPOT_API fasttgba_product : public fasttgba
125  {
126  public:
127  // ------------------------------------------------------------
128  // Fast tgba interface
129  // ------------------------------------------------------------
130  fasttgba_product(const fasttgba* left,
131  const fasttgba* right,
132  bool left_is_kripke = false);
133  virtual ~fasttgba_product();
134 
135  virtual fasttgba_state* get_init_state() const;
136 
137  virtual fasttgba_succ_iterator*
138  succ_iter(const fasttgba_state* local_state) const;
139 
140  virtual fasttgba_succ_iterator*
141  swarm_succ_iter(const fasttgba_state* local_state) const;
142 
143  virtual
144  ap_dict& get_dict() const;
145 
146  virtual
147  acc_dict& get_acc() const;
148 
149  virtual
150  std::string format_state(const fasttgba_state* state) const;
151 
152  virtual std::string
153  transition_annotation(const fasttgba_succ_iterator* t) const;
154 
155  virtual fasttgba_state* project_state(const fasttgba_state* s,
156  const fasttgba* t) const;
157  virtual
158  markset all_acceptance_marks() const;
159 
160  virtual
161  unsigned int number_of_acceptance_marks() const;
162 
163  protected:
164  const fasttgba* left_;
165  const fasttgba* right_;
166  mutable fixed_size_pool pool_;
167  bool kripke_left;
168  };
169 }
170 
171 #endif // SPOT_FASTTGBA_FASTTGBA_PRODUCT_HH
const fasttgba * left_
The left aut. of the product.
Definition: fasttgba_product.hh:164
virtual void next()
Jump to the next successor (if any).
fasttgba_succ_iterator * left_
Reference on the left iterator.
Definition: fasttgba_product.hh:105
Definition: fasttgba.hh:33
fasttgba_succ_iterator * right_
Reference on the right iterator.
Definition: fasttgba_product.hh:106
bool kripke_left
The left automaton is a Kripke.
Definition: fasttgba_product.hh:167
bool kripke_left
The left automaton is a Kripke.
Definition: fasttgba_product.hh:108
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
virtual void destroy() const
Release a state.
This class represents a product state.
Definition: fasttgba_product.hh:34
Abstract class for states.
Definition: state.hh:40
virtual fasttgba_state * current_state() const
Get the state of the current successor.
virtual const fasttgba_state * right() const
An accessor to the right part of a state.
This class represents conjunction of variables.
Definition: cube.hh:34
This class is used to create a dictionary that will contain all atomic propositions that are needed b...
Definition: ap_dict.hh:41
Iterate over the successors of a state.
Definition: fasttgba_succ_iterator.hh:35
virtual fasttgba_succ_iterator * left() const
An accessor to the left iterator.
This class allows to do a synchronized product between two fast tgba.
Definition: fasttgba_product.hh:124
virtual size_t hash() const
Hash a state.
virtual markset current_acceptance_marks() const
Get the acceptance conditions on the transition leading to this successor.
virtual bool done() const
Check whether the iteration is finished.
This class represents a set of acceptance marks.
Definition: markset.hh:35
virtual void * external_information() const
Definition: acc_dict.hh:31
virtual const fasttgba_state * left() const
An accessor to the left part of a state.
const fasttgba * right_
The right aut. of the product.
Definition: fasttgba_product.hh:165
virtual fasttgba_succ_iterator * right() const
An accessor to the right iterator.
virtual cube current_condition() const
Get the condition on the transition leading to this successor.
This is an iterator for the product.
Definition: fasttgba_product.hh:76
virtual int compare(const fasttgba_state *other) const
Compares two states (that come from the same automaton).
virtual fasttgba_state * clone() const
Duplicate a state.
A fixed-size memory pool implementation.
Definition: fixpool.hh:31
virtual void first()
Position the iterator on the first successor (if any).

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Tue Jan 21 2014 16:52:01 for spot by doxygen 1.8.5