spot  0.9.2
gtec.hh
Go to the documentation of this file.
1 // Copyright (C) 2008 Laboratoire de Recherche et Development de
2 // l'Epita (LRDE).
3 // Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
4 // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
5 // Université Pierre et Marie Curie.
6 //
7 // This file is part of Spot, a model checking library.
8 //
9 // Spot is free software; you can redistribute it and/or modify it
10 // under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // Spot is distributed in the hope that it will be useful, but WITHOUT
15 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 // License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with Spot; see the file COPYING. If not, write to the Free
21 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 // 02111-1307, USA.
23 
24 #ifndef SPOT_TGBAALGOS_GTEC_GTEC_HH
25 # define SPOT_TGBAALGOS_GTEC_GTEC_HH
26 
27 #include <stack>
28 #include "status.hh"
29 #include "tgbaalgos/emptiness.hh"
31 
32 namespace spot
33 {
36 
140  emptiness_check*
141  couvreur99(const tgba* a,
142  option_map options = option_map(),
143  const numbered_state_heap_factory* nshf
145 
146 
151  {
152  public:
153  couvreur99_check(const tgba* a,
154  option_map o = option_map(),
155  const numbered_state_heap_factory* nshf
157  virtual ~couvreur99_check();
158 
160  virtual emptiness_check_result* check();
161 
162  virtual std::ostream& print_stats(std::ostream& os) const;
163 
172  const couvreur99_check_status* result() const;
173 
174  protected:
181  void remove_component(const state* start_delete);
182 
184  bool poprem_;
187  unsigned get_removed_components() const;
188  unsigned get_vmsize() const;
189  };
190 
196  {
197  public:
198  couvreur99_check_shy(const tgba* a,
199  option_map o = option_map(),
200  const numbered_state_heap_factory* nshf
202  virtual ~couvreur99_check_shy();
203 
204  virtual emptiness_check_result* check();
205 
206  protected:
207  struct successor {
208  bdd acc;
209  const spot::state* s;
210  successor(bdd acc, const spot::state* s): acc(acc), s(s) {}
211  };
212 
213  // We use five main data in this algorithm:
214  // * couvreur99_check::root, a stack of strongly connected components (SCC),
215  // * couvreur99_check::h, a hash of all visited nodes, with their order,
216  // (it is called "Hash" in Couvreur's paper)
217  // * arc, a stack of acceptance conditions between each of these SCC,
218  std::stack<bdd> arc;
219  // * num, the number of visited nodes. Used to set the order of each
220  // visited node,
221  int num;
222  // * todo, the depth-first search stack. This holds pairs of the
223  // form (STATE, SUCCESSORS) where SUCCESSORS is a list of
224  // (ACCEPTANCE_CONDITIONS, STATE) pairs.
225  typedef std::list<successor> succ_queue;
226 
227  // Position in the loop seeking known successors.
228  succ_queue::iterator pos;
229 
230  struct todo_item
231  {
232  const state* s;
233  int n;
234  succ_queue q; // Unprocessed successors of S
235  todo_item(const state* s, int n, couvreur99_check_shy* shy);
236  };
237 
238  typedef std::list<todo_item> todo_list;
240 
241  void clear_todo();
242 
244  void dump_queue(std::ostream& os = std::cerr);
245 
247  bool group_;
248  // If the "group2" option is set (it implies "group"), we
249  // reprocess the successor states of SCC that have been merged.
250  bool group2_;
251  // If the onepass option is true, do only one pass. This cancels
252  // all the "shyness" of the algorithm, but we need the framework
253  // of the implementation when working with GreatSPN.
254  bool onepass_;
255 
265  };
266 
267 
269 }
270 
271 #endif // SPOT_TGBAALGOS_GTEC_GTEC_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Jul 2 2012 17:35:47 for spot by doxygen 1.8.1.1