spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fasttgba_explicit.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_EXPLICIT_HH
20 # define SPOT_FASTTGBA_FASTTGBA_EXPLICIT_HH
21 
22 #include <list>
23 #include "fasttgba.hh"
24 #include "misc/hash.hh"
25 
26 namespace spot
27 {
28  class fast_explicit_state;
29 
33  struct transition
34  {
38 
39  virtual ~transition(){};
40 
42  : conditions(c),
44  {
45  dst = d;
46  }
47 
48  };
49 
50 
53  enum scc_strength {
54  STRONG_SCC,
55  WEAK_SCC,
56  TERMINAL_SCC,
57  NON_ACCEPTING_SCC,
58  UNKNOWN_SCC
59  };
60 
61  enum aut_strength {
62  STRONG_AUT,
63  WEAK_AUT,
64  TERMINAL_AUT,
65  };
66 
67 
73  {
74  protected:
75  int label_;
76  enum scc_strength strength_;
77  public:
78  fast_explicit_state(int label);
79  virtual int compare(const fasttgba_state* other) const;
80  virtual size_t hash() const;
81  virtual fasttgba_state* clone() const;
82  virtual void* external_information() const;
83  virtual int label() const;
84  virtual void destroy() const;
85 
87  void add_successor(const struct transition *t);
88 
90  void set_strength(enum scc_strength str);
91 
92  enum scc_strength get_strength() const;
93 
94  std::vector<const struct transition*> successors;
95 
96  mutable int count_;
97  };
98 
99 
106  {
107  protected :
109  std::vector
110  <const struct transition*>::const_iterator it_;
111  bool swarming_;
112  std::vector<int> crossref_;
113  std::vector<int>::const_iterator it_ref;
114  public:
116  bool swarming = false);
117  virtual ~fast_explicit_iterator();
118  virtual void first();
119  virtual void next();
120  virtual bool done() const;
121  virtual fasttgba_state* current_state() const;
122  virtual cube current_condition() const;
123  virtual markset current_acceptance_marks() const;
124  };
125 
126 
132  class SPOT_API fasttgbaexplicit : public fasttgba
133  {
134  public:
135 
136  // -------------------------------------------------------
137  // The FASTTGBA interface
138  // -------------------------------------------------------
139 
145  acc_dict* acc);
146 
147  virtual ~fasttgbaexplicit();
148 
149  virtual fasttgba_state* get_init_state() const;
150 
151  virtual fasttgba_succ_iterator*
152  succ_iter(const fasttgba_state* local_state) const;
153 
154  virtual fasttgba_succ_iterator*
155  swarm_succ_iter(const fasttgba_state* state) const;
156 
157  virtual
158  ap_dict& get_dict() const;
159 
160  virtual
161  acc_dict& get_acc() const;
162 
163  virtual
164  std::string format_state(const fasttgba_state* state) const;
165 
166  virtual std::string
167  transition_annotation(const fasttgba_succ_iterator* t) const;
168 
169  virtual fasttgba_state* project_state(const fasttgba_state* s,
170  const fasttgba* t) const;
171  virtual
172  markset all_acceptance_marks() const;
173 
174  virtual
175  unsigned int number_of_acceptance_marks() const;
176 
183  aut_strength get_strength() const
184  {
185  return strength_;
186  }
187 
188  // -------------------------------------------------------
189  // This part is for creating a new FASTTGBAEXPLICIT
190  // -------------------------------------------------------
191 
199  fast_explicit_state* add_state(int s);
200 
207  void add_transition(int src, int dst,
208  cube cond, markset acc);
209 
211  void set_strength(aut_strength s)
212  {
213  strength_ = s;
214  }
215 
216  protected:
220  const fasttgba_state* init_;
221 
222  typedef Sgi::hash_map<int, fast_explicit_state*, identity_hash<int> > sm;
224  aut_strength strength_;
225  };
226 }
227 
228 #endif // SPOT_FASTTGBA_FASTTGBA_EXPLICIT_HH
Definition: fasttgba_explicit.hh:132
ap_dict * aps_
The set of atomic proposition.
Definition: fasttgba_explicit.hh:218
the structure that will store the successors of a state
Definition: fasttgba_explicit.hh:33
void set_strength(aut_strength s)
set the strength of an automaton
Definition: fasttgba_explicit.hh:211
std::vector< const struct transition * >::const_iterator it_
current iterator
Definition: fasttgba_explicit.hh:110
Definition: fasttgba.hh:33
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
Abstract class for states.
Definition: state.hh:40
acc_dict * acc_
The set of acceptance mark.
Definition: fasttgba_explicit.hh:219
aut_strength get_strength() const
Ease to detect the strength of an automaton.
Definition: fasttgba_explicit.hh:183
virtual void next()
Jump to the next successor (if any).
const fast_explicit_state * dst
the destination state
Definition: fasttgba_explicit.hh:37
virtual fasttgba_state * current_state() const
Get the state of the current successor.
virtual fasttgba_state * clone() const
Duplicate a state.
std::vector< const struct transition * > successors
list of successors
Definition: fasttgba_explicit.hh:94
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
void set_strength(enum scc_strength str)
the strength of the SCC
scc_strength
this enum is used to provide the stregth of the SCC
Definition: fasttgba_explicit.hh:53
virtual bool done() const
Check whether the iteration is finished.
virtual cube current_condition() const
Get the condition on the transition leading to this successor.
Iterate over the successors of a state.
Definition: fasttgba_succ_iterator.hh:35
virtual size_t hash() const
Hash a state.
This class represents a set of acceptance marks.
Definition: markset.hh:35
virtual int compare(const fasttgba_state *other) const
Compares two states (that come from the same automaton).
Definition: fasttgba_explicit.hh:72
virtual void first()
Position the iterator on the first successor (if any).
const fast_explicit_state * start_
src of iterator
Definition: fasttgba_explicit.hh:108
virtual void * external_information() const
cube conditions
condition over an arc
Definition: fasttgba_explicit.hh:35
Definition: acc_dict.hh:31
virtual void destroy() const
Release a state.
markset all_marks_
the set of acceptance mark
Definition: fasttgba_explicit.hh:217
sm state_map_
The states of the automaton.
Definition: fasttgba_explicit.hh:223
virtual markset current_acceptance_marks() const
Get the acceptance conditions on the transition leading to this successor.
an iterator for fast_explicit_state
Definition: fasttgba_explicit.hh:105
markset acceptance_marks
acceptance mark over an arc
Definition: fasttgba_explicit.hh:36

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