spot 2.16
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

Wrap TGBA/BA/Monitor post-processing algorithms in an easy interface. More...

#include <spot/twaalgos/postproc.hh>

Inheritance diagram for spot::postprocessor:
Collaboration diagram for spot::postprocessor:

Public Types

enum  output_type {
  TGBA = 0 , GeneralizedBuchi = 0 , BA = 1 , Monitor = 2 ,
  Generic = 3 , Parity = 4 , ParityMin = Parity | 8 , ParityMax = Parity | 16 ,
  ParityOdd = Parity | 32 , ParityEven = Parity | 64 , ParityMinOdd = ParityMin | ParityOdd , ParityMaxOdd = ParityMax | ParityOdd ,
  ParityMinEven = ParityMin | ParityEven , ParityMaxEven = ParityMax | ParityEven , CoBuchi = 128 , Buchi = 256 ,
  Finite = 512
}
 Output type selection. More...
 
enum  {
  Any = 0 , Small = 1 , Deterministic = 2 , Complete = 4 ,
  SBAcc = 8 , Unambiguous = 16 , Colored = 32 , Obligation = 64
}
 
enum  optimization_level { Low , Medium , High }
 Optimization level selection. More...
 
typedef int output_pref
 Output preferences bitmask.
 

Public Member Functions

 postprocessor (const option_map *opt=nullptr)
 Construct a postprocessor.
 
void set_type (output_type type)
 Select the desired output type.
 
void set_pref (output_pref pref)
 Select the desired characteristics of the output automaton.
 
void set_level (optimization_level level)
 Set the optimization level.
 
twa_graph_ptr run (twa_graph_ptr input, formula f=nullptr)
 Optimize an automaton.
 

Protected Member Functions

twa_graph_ptr do_simul (const twa_graph_ptr &input, int opt) const
 Perform the simulation step.
 
twa_graph_ptr do_sba_simul (const twa_graph_ptr &input, int opt) const
 Perform state-based acceptance simulation.
 
twa_graph_ptr choose_degen (const twa_graph_ptr &input) const
 Choose degeneralization strategy.
 
twa_graph_ptr do_degen (const twa_graph_ptr &input) const
 Perform the degeneralization step.
 
twa_graph_ptr do_degen_tba (const twa_graph_ptr &input) const
 Perform TBA degeneralization.
 
twa_graph_ptr do_scc_filter (const twa_graph_ptr &a, bool arg) const
 Perform the SCC filter step.
 
twa_graph_ptr do_scc_filter (const twa_graph_ptr &a) const
 Perform the SCC filter step.
 
twa_graph_ptr finalize (twa_graph_ptr tmp) const
 Finalize the automaton.
 

Protected Attributes

output_type type_ = TGBA
 Output type option.
 
int pref_ = Small
 Output preference option.
 
optimization_level level_ = High
 Optimization level option.
 
bool degen_reset_ = true
 Degeneralization reset option.
 
bool degen_order_ = false
 Degeneralization order option.
 
int degen_cache_ = 1
 Degeneralization cache option.
 
bool degen_lskip_ = true
 Degeneralization level-skip option.
 
bool degen_lowinit_ = false
 Degeneralization low-init option.
 
bool degen_remscc_ = true
 Degeneralization remove-SCC option.
 
bool det_scc_ = true
 Determinization use-SCC option.
 
int det_simul_ = -1
 Determinization simulation option.
 
bool det_stutter_ = true
 Determinization stutter option.
 
int det_max_states_ = -1
 Determinization max states limit.
 
int det_max_edges_ = -1
 Determinization max edges limit.
 
int simul_ = -1
 Simulation option.
 
int simul_method_ = -1
 Simulation method option.
 
int simul_trans_pruning_ = 512
 Simulation transition pruning option.
 
int dpa_simul_ = -1
 DPA simulation option.
 
int dba_simul_ = -1
 DBA simulation option.
 
int scc_filter_ = -1
 SCC filter option.
 
int ba_simul_ = -1
 BA simulation option.
 
bool tba_determinisation_ = false
 TBA determinization option.
 
int sat_minimize_ = 0
 SAT minimization option.
 
int sat_incr_steps_ = 0
 SAT incremental steps option.
 
bool sat_langmap_ = false
 SAT language map option.
 
int sat_acc_ = 0
 SAT acceptance sets option.
 
int sat_states_ = 0
 SAT states option.
 
int gen_reduce_parity_ = 1
 Generalized parity reduction option.
 
bool state_based_ = false
 State-based acceptance option.
 
int wdba_minimize_ = -1
 WDBA minimization option.
 
int simul_max_ = 4096
 Simulation max states option.
 
int merge_states_min_ = 128
 Merge states minimum option.
 
int wdba_det_max_ = 4096
 WDBA determinization max states.
 
bool acd_ = true
 ACD option.
 
bool acd_was_used_
 Whether ACD was used.
 
int rde_ = -1
 RDE option.
 

Detailed Description

Wrap TGBA/BA/Monitor post-processing algorithms in an easy interface.

This class is a shell around scc_filter(), minimize_obligation(), simulation(), iterated_simulations(), degeneralize(), to_generalized_buchi(), tgba_determinize(), and other algorithms. These different algorithms will be combined depending on the various options set with set_type(), set_pref(), and set_level().

This helps hiding some of the logic required to combine these simplifications efficiently (e.g., there is no point calling degeneralize() or any simulation when minimize_obligation() succeeded.)

Use set_type() to select desired output type.

Use the set_pref() method to specify whether you favor deterministic automata or small automata. If you don't care, less post processing will be done.

The set_level() method lets you set the optimization level. A higher level enables more costly post-processings. For instance pref=Small,level=High will try two different post-processings (one with minimize_obligation(), and one with iterated_simulations()) and keep the smallest result. pref=Small,level=Medium will only try the iterated_simulations() when minimized_obligation failed to produce an automaton smaller than its input. pref=Small,level=Low will only run simulation().

The handling of alternating automata should change in the future, but currently Generic, Low, Any is the only configuration where alternation is preserved. In any other configuration, remove_alternation() will be called.

Member Typedef Documentation

◆ output_pref

Output preferences bitmask.

Member Enumeration Documentation

◆ optimization_level

Optimization level selection.

◆ output_type

Output type selection.

Constructor & Destructor Documentation

◆ postprocessor()

spot::postprocessor::postprocessor ( const option_map opt = nullptr)

Construct a postprocessor.

The opt argument can be used to pass extra fine-tuning options used for debugging or benchmarking.

Member Function Documentation

◆ choose_degen()

twa_graph_ptr spot::postprocessor::choose_degen ( const twa_graph_ptr input) const
protected

Choose degeneralization strategy.

◆ do_degen()

twa_graph_ptr spot::postprocessor::do_degen ( const twa_graph_ptr input) const
protected

Perform the degeneralization step.

◆ do_degen_tba()

twa_graph_ptr spot::postprocessor::do_degen_tba ( const twa_graph_ptr input) const
protected

Perform TBA degeneralization.

◆ do_sba_simul()

twa_graph_ptr spot::postprocessor::do_sba_simul ( const twa_graph_ptr input,
int  opt 
) const
protected

Perform state-based acceptance simulation.

◆ do_scc_filter() [1/2]

twa_graph_ptr spot::postprocessor::do_scc_filter ( const twa_graph_ptr a) const
protected

Perform the SCC filter step.

◆ do_scc_filter() [2/2]

twa_graph_ptr spot::postprocessor::do_scc_filter ( const twa_graph_ptr a,
bool  arg 
) const
protected

Perform the SCC filter step.

◆ do_simul()

twa_graph_ptr spot::postprocessor::do_simul ( const twa_graph_ptr input,
int  opt 
) const
protected

Perform the simulation step.

◆ finalize()

twa_graph_ptr spot::postprocessor::finalize ( twa_graph_ptr  tmp) const
protected

Finalize the automaton.

◆ run()

twa_graph_ptr spot::postprocessor::run ( twa_graph_ptr  input,
formula  f = nullptr 
)

Optimize an automaton.

The returned automaton might be a new automaton, or an in-place modification of the input automaton.

◆ set_level()

void spot::postprocessor::set_level ( optimization_level  level)
inline

Set the optimization level.

At Low level, very few simplifications are performed on the automaton. Use this level if you need a result that matches the other constraints, but want it fast.

At High level, several simplifications are chained, but also the result of different algorithms may be compared to pick the best result. This might be slow.

At Medium level, several simplifications are chained, but only one such "pipeline" is used.

If set_level() is not called, the default output_type is High.

◆ set_pref()

void spot::postprocessor::set_pref ( output_pref  pref)
inline

Select the desired characteristics of the output automaton.

Use Any if you do not care about any feature of the output automaton: less processing will be done.

Small and Deterministic are exclusive choices and indicate whether a smaller non-deterministic automaton should be preferred over a deterministic automaton. These are preferences. The Small option does not guarantee that the resulting automaton will be minimal. The Deterministic option may not manage to produce a deterministic automaton if the target acceptance set with set_type() is TGBA or BA (and even if such automaton exists).

Use

set_type(postprocessor::Generic);
set_pref(postprocessor::Deterministic);
void set_pref(output_pref pref)
Select the desired characteristics of the output automaton.
Definition postproc.hh:207
void set_type(output_type type)
Select the desired output type.
Definition postproc.hh:140

if you absolutely want a deterministic automaton. The resulting deterministic automaton may have generalized Büchi acceptance or parity acceptance.

The above options can be combined with Complete and SBAcc, to request a complete automaton, and an automaton with state-based acceptance. Automata with parity acceptance may also be required to be Colored, ensuring that each transition (or state) belongs to exactly one acceptance set.

Note 1: the Unambiguous option is not actually supported by spot::postprocessor; it is only honored by spot::translator.

Note 2: for historical reasons, option SBAcc is implied when the output type is set to BA.

Note 3: while setting the output type to Monitor requests automata with t as acceptance condition, combining Monitor with Complete may produce Büchi automata in case a sink state (which should be rejecting) is added.

Note 4: Obligation is not really an output preference, but rather an indication that the input can be assumed to be an Obligation, bypassing some unnecessary checks. This is set automatically by the translator when translating LTLf formulas, so it is probably best considered as an implementation detail.

If set_pref() is not called, the default output_type is Small.

◆ set_type()

void spot::postprocessor::set_type ( output_type  type)
inline

Select the desired output type.

GeneralizedBuchi requires generalized Büchi acceptance while Buchi requests Büchi acceptance. In both cases, automata with more complex acceptance conditions will be converted into these simpler acceptance. For references about the algorithms used behind these options, see section 5 of "LTL translation improvements in Spot 1.0" (Alexandre Duret-Lutz. Int. J. on Critical Computer-Based Systems, 5(1/2), pp. 31–54, March 2014).

Monitor requests an automaton where all paths are accepting: this is less expressive than Büchi automata, and may output automata that recognize a larger language than the input (the output recognizes the smallest safety property containing the input). The algorithm used to obtain monitors comes from "Efficient monitoring of ω-languages" (Marcelo d’Amorim and Grigoire Roşu, Proceedings of CAV’05, LNCS 3576) but is better described in "Optimized Temporal Monitors for SystemC" (Deian Tabakov and Moshe Y. Vardi, Proceedings of RV’10, LNCS 6418).

Generic removes all constraints about the acceptance condition. Using Generic (or Parity below) can be needed to force the determinization of some automata (e.g., not all TGBA can be degeneralized, using Generic will allow parity acceptance to be used instead).

Parity and its variants request the acceptance condition to be of some parity type. Note that the determinization algorithm used by Spot produces "parity min odd" acceptance, but other parity types can be obtained from there by minor adjustments.

CoBuchi requests a Co-Büchi automaton equivalent to the input, when possible, or a Co-Büchi automaton that recognizes a larger language otherwise.

BA is a historical type that means Buchi and additionally sets state-based acceptance (this should normally be set with set_pref(SBAcc)).

If set_type() is not called, the default output_type is GeneralizedBuchi.

Member Data Documentation

◆ acd_

bool spot::postprocessor::acd_ = true
protected

ACD option.

◆ acd_was_used_

bool spot::postprocessor::acd_was_used_
protected

Whether ACD was used.

◆ ba_simul_

int spot::postprocessor::ba_simul_ = -1
protected

BA simulation option.

◆ dba_simul_

int spot::postprocessor::dba_simul_ = -1
protected

DBA simulation option.

◆ degen_cache_

int spot::postprocessor::degen_cache_ = 1
protected

Degeneralization cache option.

◆ degen_lowinit_

bool spot::postprocessor::degen_lowinit_ = false
protected

Degeneralization low-init option.

◆ degen_lskip_

bool spot::postprocessor::degen_lskip_ = true
protected

Degeneralization level-skip option.

◆ degen_order_

bool spot::postprocessor::degen_order_ = false
protected

Degeneralization order option.

◆ degen_remscc_

bool spot::postprocessor::degen_remscc_ = true
protected

Degeneralization remove-SCC option.

◆ degen_reset_

bool spot::postprocessor::degen_reset_ = true
protected

Degeneralization reset option.

◆ det_max_edges_

int spot::postprocessor::det_max_edges_ = -1
protected

Determinization max edges limit.

◆ det_max_states_

int spot::postprocessor::det_max_states_ = -1
protected

Determinization max states limit.

◆ det_scc_

bool spot::postprocessor::det_scc_ = true
protected

Determinization use-SCC option.

◆ det_simul_

int spot::postprocessor::det_simul_ = -1
protected

Determinization simulation option.

◆ det_stutter_

bool spot::postprocessor::det_stutter_ = true
protected

Determinization stutter option.

◆ dpa_simul_

int spot::postprocessor::dpa_simul_ = -1
protected

DPA simulation option.

◆ gen_reduce_parity_

int spot::postprocessor::gen_reduce_parity_ = 1
protected

Generalized parity reduction option.

◆ level_

optimization_level spot::postprocessor::level_ = High
protected

Optimization level option.

◆ merge_states_min_

int spot::postprocessor::merge_states_min_ = 128
protected

Merge states minimum option.

◆ pref_

int spot::postprocessor::pref_ = Small
protected

Output preference option.

◆ rde_

int spot::postprocessor::rde_ = -1
protected

RDE option.

◆ sat_acc_

int spot::postprocessor::sat_acc_ = 0
protected

SAT acceptance sets option.

◆ sat_incr_steps_

int spot::postprocessor::sat_incr_steps_ = 0
protected

SAT incremental steps option.

◆ sat_langmap_

bool spot::postprocessor::sat_langmap_ = false
protected

SAT language map option.

◆ sat_minimize_

int spot::postprocessor::sat_minimize_ = 0
protected

SAT minimization option.

◆ sat_states_

int spot::postprocessor::sat_states_ = 0
protected

SAT states option.

◆ scc_filter_

int spot::postprocessor::scc_filter_ = -1
protected

SCC filter option.

◆ simul_

int spot::postprocessor::simul_ = -1
protected

Simulation option.

◆ simul_max_

int spot::postprocessor::simul_max_ = 4096
protected

Simulation max states option.

◆ simul_method_

int spot::postprocessor::simul_method_ = -1
protected

Simulation method option.

◆ simul_trans_pruning_

int spot::postprocessor::simul_trans_pruning_ = 512
protected

Simulation transition pruning option.

◆ state_based_

bool spot::postprocessor::state_based_ = false
protected

State-based acceptance option.

◆ tba_determinisation_

bool spot::postprocessor::tba_determinisation_ = false
protected

TBA determinization option.

◆ type_

output_type spot::postprocessor::type_ = TGBA
protected

Output type option.

◆ wdba_det_max_

int spot::postprocessor::wdba_det_max_ = 4096
protected

WDBA determinization max states.

◆ wdba_minimize_

int spot::postprocessor::wdba_minimize_ = -1
protected

WDBA minimization option.


The documentation for this class was generated from the following file:

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.8