spot 2.12.2
|
Classes | |
class | spot::postprocessor |
Wrap TGBA/BA/Monitor post-processing algorithms in an easy interface. More... | |
Functions | |
twa_graph_ptr | spot::minimize_monitor (const const_twa_graph_ptr &a) |
Construct a minimal deterministic monitor. More... | |
twa_graph_ptr | spot::minimize_wdba (const const_twa_graph_ptr &a, const output_aborter *aborter=nullptr) |
Minimize a Büchi automaton in the WDBA class. More... | |
twa_graph_ptr | spot::minimize_obligation (const const_twa_graph_ptr &aut_f, formula f=nullptr, const_twa_graph_ptr aut_neg_f=nullptr, bool reject_bigger=false, const output_aborter *aborter=nullptr) |
Minimize an automaton if it represents an obligation property. More... | |
bool | spot::minimize_obligation_guaranteed_to_work (const const_twa_graph_ptr &aut_f, formula f=nullptr) |
Whether calling minimize_obligation is sure to work. More... | |
twa_graph_ptr | spot::simulation (const const_twa_graph_ptr &automaton, int trans_pruning=-1) |
Attempt to reduce the automaton by direct simulation. More... | |
twa_graph_ptr | spot::simulation (const const_twa_graph_ptr &automaton, std::vector< bdd > *implications, int trans_pruning=-1) |
twa_graph_ptr | spot::simulation_sba (const const_twa_graph_ptr &automaton, int trans_pruning=-1) |
twa_graph_ptr | spot::cosimulation (const const_twa_graph_ptr &automaton, int trans_pruning=-1) |
Attempt to reduce the automaton by reverse simulation. More... | |
twa_graph_ptr | spot::cosimulation_sba (const const_twa_graph_ptr &automaton, int trans_pruning=-1) |
Attempt to reduce the automaton by reverse simulation. More... | |
twa_graph_ptr | spot::iterated_simulations (const const_twa_graph_ptr &automaton, int trans_pruning=-1) |
Iterate simulation() and cosimulation(). More... | |
twa_graph_ptr | spot::iterated_simulations_sba (const const_twa_graph_ptr &automaton, int trans_pruning=-1) |
Iterate simulation() and cosimulation(). More... | |
twa_graph_ptr | spot::reduce_direct_sim (const const_twa_graph_ptr &aut) |
Attempt to reduce the automaton by direct simulation. More... | |
twa_graph_ptr | spot::reduce_direct_sim_sba (const const_twa_graph_ptr &aut) |
Attempt to reduce the automaton by direct simulation. More... | |
twa_graph_ptr | spot::reduce_direct_cosim (const const_twa_graph_ptr &aut) |
Attempt to reduce the automaton by reverse simulation. More... | |
twa_graph_ptr | spot::reduce_direct_cosim_sba (const const_twa_graph_ptr &aut) |
Attempt to reduce the automaton by reverse simulation. More... | |
twa_graph_ptr | spot::reduce_iterated (const const_twa_graph_ptr &aut) |
Iterate reduce_direct_sim() and reduce_direct_cosim(). More... | |
twa_graph_ptr | spot::reduce_iterated_sba (const const_twa_graph_ptr &aut) |
Iterate reduce_direct_sim() and reduce_direct_cosim(). More... | |
twa_graph_ptr spot::cosimulation | ( | const const_twa_graph_ptr & | automaton, |
int | trans_pruning = -1 |
||
) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by reverse simulation.
When the prefixes (letter and acceptance conditions) leading to one state are included in the prefixes leading to one, the former state can be merged into the latter. [1] .
Our reconstruction of the quotient automaton based on this prefix-inclusion relation will also improve codeterminism thanks to a kind of transition pruning.
We recommend to call scc_filter() to first simplify the automaton that should be reduced by cosimulation.
Reducing an automaton by reverse simulation (1) does not change the number of acceptance conditions so the resulting automaton may have superfluous acceptance conditions, and (2) can create SCCs that are terminal and non-accepting. For these reasons, you should call scc_filer() to prune useless SCCs and acceptance conditions afterwards.
If you plan to run both simulation() and cosimulation() on the same automaton, you should start with simulation() so that the codeterminism improvements achieved by cosimulation() does not hinder the determinism improvements attempted by simulation(). (This of course assumes that you prefer determinism over codeterminism.)
automaton | the automaton to simulate. |
trans_pruning | Transition pruning requires a quadratic number of BDD implication checks between all equivalence classes, so it can be costly on large automata. If trans_pruning is set to a non-negative integer, only (non-deterministic) automata with more states than trans_pruning will be simplified. |
twa_graph_ptr spot::cosimulation_sba | ( | const const_twa_graph_ptr & | automaton, |
int | trans_pruning = -1 |
||
) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by reverse simulation.
When the prefixes (letter and acceptance conditions) leading to one state are included in the prefixes leading to one, the former state can be merged into the latter. [1] .
Our reconstruction of the quotient automaton based on this prefix-inclusion relation will also improve codeterminism thanks to a kind of transition pruning.
We recommend to call scc_filter() to first simplify the automaton that should be reduced by cosimulation.
Reducing an automaton by reverse simulation (1) does not change the number of acceptance conditions so the resulting automaton may have superfluous acceptance conditions, and (2) can create SCCs that are terminal and non-accepting. For these reasons, you should call scc_filer() to prune useless SCCs and acceptance conditions afterwards.
If you plan to run both simulation() and cosimulation() on the same automaton, you should start with simulation() so that the codeterminism improvements achieved by cosimulation() does not hinder the determinism improvements attempted by simulation(). (This of course assumes that you prefer determinism over codeterminism.)
automaton | the automaton to simulate. |
trans_pruning | Transition pruning requires a quadratic number of BDD implication checks between all equivalence classes, so it can be costly on large automata. If trans_pruning is set to a non-negative integer, only (non-deterministic) automata with more states than trans_pruning will be simplified. |
twa_graph_ptr spot::iterated_simulations | ( | const const_twa_graph_ptr & | automaton, |
int | trans_pruning = -1 |
||
) |
#include <spot/twaalgos/simulation.hh>
Iterate simulation() and cosimulation().
Runs simulation(), cosimulation(), and scc_filter() in a loop, until the automaton does not change size (states and transitions).
We recommend to call scc_filter() to first simplify the automaton that should be reduced by iterated simulations, since this algorithm will only call scc_filter() at the end of the loop.
automaton | the automaton to simulate. |
twa_graph_ptr spot::iterated_simulations_sba | ( | const const_twa_graph_ptr & | automaton, |
int | trans_pruning = -1 |
||
) |
#include <spot/twaalgos/simulation.hh>
Iterate simulation() and cosimulation().
Runs simulation(), cosimulation(), and scc_filter() in a loop, until the automaton does not change size (states and transitions).
We recommend to call scc_filter() to first simplify the automaton that should be reduced by iterated simulations, since this algorithm will only call scc_filter() at the end of the loop.
automaton | the automaton to simulate. |
twa_graph_ptr spot::minimize_monitor | ( | const const_twa_graph_ptr & | a | ) |
#include <spot/twaalgos/minimize.hh>
Construct a minimal deterministic monitor.
The automaton will be converted into minimal deterministic monitor. All useless SCCs should have been previously removed (using scc_filter() for instance). Then the automaton will be determinized and minimized using the standard DFA construction as if all states were accepting states.
For more detail about monitors, see [54] . (Note: although the above paper uses Spot, this function did not exist in Spot at that time.)
a | the automaton to convert into a minimal deterministic monitor |
twa_graph_ptr spot::minimize_obligation | ( | const const_twa_graph_ptr & | aut_f, |
formula | f = nullptr , |
||
const_twa_graph_ptr | aut_neg_f = nullptr , |
||
bool | reject_bigger = false , |
||
const output_aborter * | aborter = nullptr |
||
) |
#include <spot/twaalgos/minimize.hh>
Minimize an automaton if it represents an obligation property.
This function attempts to minimize the automaton aut_f using the algorithm implemented in the minimize_wdba() function, and presented by [15] .
Because it is hard to determine if an automaton corresponds to an obligation property, you should supply either the formula f expressed by the automaton aut_f, or aut_neg_f the negation of the automaton aut_neg_f.
aut_f | the automaton to minimize |
f | the LTL formula represented by the automaton aut_f |
aut_neg_f | an automaton representing the negation of aut_f |
reject_bigger | Whether the minimal WDBA should be discarded if it has more states than the input. |
The function proceeds as follows. If the formula f or the automaton aut can easily be proved to represent an obligation formula, then the result of minimize(aut)
is returned. Otherwise, if aut_neg_f was not supplied but f was, aut_neg_f is built from the negation of f. Then we check that product(aut,!minimize(aut_f))
and product(aut_neg_f,minimize(aut))
are both empty. If they are, the the minimization was sound. (See the paper for full details.)
If reject_bigger is set, this function will return the input automaton aut_f when the minimized WDBA has more states than the input automaton. (More states are possible because of determinization step during minimize_wdba().) Note that checking the size of the minimized WDBA occurs before ensuring that the minimized WDBA is correct.
If an output_aborter is given, the determinization is aborted whenever it would produce an automaton that is too large. In this case, aut_f is returned unchanged.
bool spot::minimize_obligation_guaranteed_to_work | ( | const const_twa_graph_ptr & | aut_f, |
formula | f = nullptr |
||
) |
#include <spot/twaalgos/minimize.hh>
Whether calling minimize_obligation is sure to work.
This checks whether f is a syntactic obligation, or if aut_f obviously corresponds to an obligation (for instance if this is a terminal automaton, or if it is both weak and deterministic). In this case, calling minimize_obligation() should not be a waste of time, as it will return a new automaton.
If this function returns false, the input property might still be a pathological obligation. The only way to know is to call minimize_obligation(), but as it is less likely, you might decide to save time.
twa_graph_ptr spot::minimize_wdba | ( | const const_twa_graph_ptr & | a, |
const output_aborter * | aborter = nullptr |
||
) |
#include <spot/twaalgos/minimize.hh>
Minimize a Büchi automaton in the WDBA class.
This takes a TGBA whose language is representable by a Weak Deterministic Büchi Automaton, and construct a minimal WDBA for this language. This essentially chains three algorithms: determinization, acceptance adjustment (Löding's coloring algorithm), and minimization (using a Moore-like approach).
If the input automaton does not represent a WDBA language, the resulting automaton is still a WDBA, but it will accept a superset of the original language. Use the minimize_obligation() function if you are not sure whether it is safe to call this function.
The construction is inspired by the following paper, however we guarantee that the output language is a subsets of the original language while they don't. [15]
If an output_aborter is given, the determinization is aborted whenever it would produce an automaton that is too large. In that case, a nullptr is returned.
twa_graph_ptr spot::reduce_direct_cosim | ( | const const_twa_graph_ptr & | aut | ) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by reverse simulation.
Reverse the automaton, compute the simulation and reduce it in the same way as reduce_direct_sim().
There is no need to call scc_filter() before as it is always applied to remove dead and unreachable states.
aut | the automaton to simulate. |
twa_graph_ptr spot::reduce_direct_cosim_sba | ( | const const_twa_graph_ptr & | aut | ) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by reverse simulation.
Reverse the automaton, compute the simulation and reduce it in the same way as reduce_direct_sim().
There is no need to call scc_filter() before as it is always applied to remove dead and unreachable states.
aut | the automaton to simulate. |
twa_graph_ptr spot::reduce_direct_sim | ( | const const_twa_graph_ptr & | aut | ) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by direct simulation.
Compute direct simulation for all states using [12], then reduce the automaton.
There is no need to call scc_filter() before as it is always applied to remove dead and unreachable states.
aut | the automaton to simulate. |
twa_graph_ptr spot::reduce_direct_sim_sba | ( | const const_twa_graph_ptr & | aut | ) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by direct simulation.
Compute direct simulation for all states using [12], then reduce the automaton.
There is no need to call scc_filter() before as it is always applied to remove dead and unreachable states.
aut | the automaton to simulate. |
twa_graph_ptr spot::reduce_iterated | ( | const const_twa_graph_ptr & | aut | ) |
#include <spot/twaalgos/simulation.hh>
Iterate reduce_direct_sim() and reduce_direct_cosim().
Runs reduce_direct_sim() and reduce_direct_cosim() in a loop, until the automaton does not change size (states and transitions).
There is no need to call scc_filter() before as it is always applied to remove dead and unreachable states.
aut | the automaton to simulate. |
twa_graph_ptr spot::reduce_iterated_sba | ( | const const_twa_graph_ptr & | aut | ) |
#include <spot/twaalgos/simulation.hh>
Iterate reduce_direct_sim() and reduce_direct_cosim().
Runs reduce_direct_sim() and reduce_direct_cosim() in a loop, until the automaton does not change size (states and transitions).
There is no need to call scc_filter() before as it is always applied to remove dead and unreachable states.
aut | the automaton to simulate. |
twa_graph_ptr spot::simulation | ( | const const_twa_graph_ptr & | automaton, |
int | trans_pruning = -1 |
||
) |
#include <spot/twaalgos/simulation.hh>
Attempt to reduce the automaton by direct simulation.
When the suffixes (letter and acceptance conditions) reachable from one state are included in the suffixes seen by another one, the former state can be merged into the latter. The algorithm is described in [1] .
Our reconstruction of the quotient automaton based on this suffix-inclusion relation will also improve determinism thanks to a kind of transition-pruning.
We recommend to call scc_filter() to first simplify the automaton that should be reduced by simulation.
Reducing an automaton by simulation does not change the number of acceptance conditions. In some rare cases (1 out of more than 500 in our benchmark), the reduced automaton will use more acceptance conditions than necessary, and running scc_filter() again afterwards will remove these superfluous conditions.
The resulting automaton has a named property "simulated-states", that is a vector mapping each state of the input to a state of the output. Note that some input states may be mapped to -1, as a by-product of transition pruning.
automaton | the automaton to simulate. |
trans_pruning | Transition pruning requires a quadratic number of BDD implication checks between all equivalence classes, so it can be costly on large automata. If trans_pruning is set to a non-negative integer, only (non-deterministic) automata with more states than trans_pruning will be simplified. |