spot  2.14.5
postproc.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) by the Spot authors, see the AUTHORS file for details.
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 #pragma once
20 
21 #include <spot/twa/twagraph.hh>
22 
23 namespace spot
24 {
25  class option_map;
26 
29 
65  class SPOT_API postprocessor
66  {
67  public:
72  postprocessor(const option_map* opt = nullptr);
73 
74  enum output_type {
75  TGBA = 0, // Historical. Use GeneralizedBuchi instead
76  GeneralizedBuchi = 0, // Introduced in Spot 2.10 to replace TGBA
77  BA = 1, // Historical. Implies Buchi and SBAcc.
78  Monitor = 2,
79  Generic = 3,
80  Parity = 4,
81  ParityMin = Parity | 8,
82  ParityMax = Parity | 16,
83  ParityOdd = Parity | 32,
84  ParityEven = Parity | 64,
85  ParityMinOdd = ParityMin | ParityOdd,
86  ParityMaxOdd = ParityMax | ParityOdd,
87  ParityMinEven = ParityMin | ParityEven,
88  ParityMaxEven = ParityMax | ParityEven,
89  CoBuchi = 128,
90  Buchi = 256, // introduced in Spot 2.10, does not imply SBAcc
91  Finite = 512, // introduced in Spot 2.13, used only by translator
92  };
93 
138  void
139  set_type(output_type type)
140  {
141  type_ = type;
142  }
143 
144  enum
145  {
146  Any = 0,
147  Small = 1, // Small and Deterministic
148  Deterministic = 2, // are exclusive choices.
149  Complete = 4,
150  SBAcc = 8, // State-based acceptance.
151  Unambiguous = 16,
152  Colored = 32, // Colored parity; requires parity acceptance
153  Obligation = 64, // Assume the input is an obligation (Spot≥2.13)
154  };
155  typedef int output_pref;
156 
204  void
205  set_pref(output_pref pref)
206  {
207  pref_ = pref;
208  }
209 
210  enum optimization_level { Low, Medium, High };
225  void
226  set_level(optimization_level level)
227  {
228  level_ = level;
229  }
230 
235  twa_graph_ptr run(twa_graph_ptr input, formula f = nullptr);
236 
237  protected:
238  twa_graph_ptr do_simul(const twa_graph_ptr& input, int opt) const;
239  twa_graph_ptr do_sba_simul(const twa_graph_ptr& input, int opt) const;
240  twa_graph_ptr choose_degen(const twa_graph_ptr& input) const;
241  twa_graph_ptr do_degen(const twa_graph_ptr& input) const;
242  twa_graph_ptr do_degen_tba(const twa_graph_ptr& input) const;
243  twa_graph_ptr do_scc_filter(const twa_graph_ptr& a, bool arg) const;
244  twa_graph_ptr do_scc_filter(const twa_graph_ptr& a) const;
245  twa_graph_ptr finalize(twa_graph_ptr tmp) const;
246 
247  output_type type_ = TGBA;
248  int pref_ = Small;
249  optimization_level level_ = High;
250  // Fine-tuning options fetched from the option_map.
251  bool degen_reset_ = true;
252  bool degen_order_ = false;
253  int degen_cache_ = 1;
254  bool degen_lskip_ = true;
255  bool degen_lowinit_ = false;
256  bool degen_remscc_ = true;
257  bool det_scc_ = true;
258  int det_simul_ = -1;
259  bool det_stutter_ = true;
260  int det_max_states_ = -1;
261  int det_max_edges_ = -1;
262  int simul_ = -1;
263  int simul_method_ = -1;
264  int simul_trans_pruning_ = 512;
265  int dpa_simul_ = -1;
266  int dba_simul_ = -1;
267  int scc_filter_ = -1;
268  int ba_simul_ = -1;
269  bool tba_determinisation_ = false;
270  int sat_minimize_ = 0;
271  int sat_incr_steps_ = 0;
272  bool sat_langmap_ = false;
273  int sat_acc_ = 0;
274  int sat_states_ = 0;
275  int gen_reduce_parity_ = 1;
276  bool state_based_ = false;
277  int wdba_minimize_ = -1;
278  int simul_max_ = 4096;
279  int merge_states_min_ = 128;
280  int wdba_det_max_ = 4096;
281  bool acd_ = true;
282  bool acd_was_used_;
283  int rde_ = -1;
284  };
286 }
Main class for temporal logic formula.
Definition: formula.hh:786
Manage a map of options.
Definition: optionmap.hh:34
Wrap TGBA/BA/Monitor post-processing algorithms in an easy interface.
Definition: postproc.hh:66
void set_pref(output_pref pref)
Select the desired characteristics of the output automaton.
Definition: postproc.hh:205
postprocessor(const option_map *opt=nullptr)
Construct a postprocessor.
void set_level(optimization_level level)
Set the optimization level.
Definition: postproc.hh:226
twa_graph_ptr run(twa_graph_ptr input, formula f=nullptr)
Optimize an automaton.
void set_type(output_type type)
Select the desired output type.
Definition: postproc.hh:139
Definition: automata.hh:26

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1