spot
2.1.1
|
A Transition-based Generalized Testing Automaton (TGTA). More...
#include <spot/ta/tgta.hh>
Public Member Functions | |
virtual twa_succ_iterator * | succ_iter_by_changeset (const spot::state *s, bdd change_set) const =0 |
Get an iterator over the successors of state filtred by the value of the changeset on transitions between the state and his successors. More... | |
virtual const state * | get_init_state () const =0 |
Get the initial state of the automaton. More... | |
virtual twa_succ_iterator * | succ_iter (const state *local_state) const =0 |
Get an iterator over the successors of local_state. More... | |
internal::twa_succ_iterable | succ (const state *s) const |
Build an iterable over the successors of s. More... | |
void | release_iter (twa_succ_iterator *i) const |
Release an iterator after usage. More... | |
bdd_dict_ptr | get_dict () const |
Get the dictionary associated to the automaton. More... | |
void | unregister_ap (int num) |
Unregister an atomic proposition. More... | |
void | register_aps_from_dict () |
Register all atomic propositions that have already be register by the bdd_dict for this automaton. More... | |
const std::vector< formula > & | ap () const |
The vector of atomic propositions registered by this automaton. More... | |
bdd | ap_vars () const |
The set of atomic propositions as a conjunction. More... | |
virtual std::string | format_state (const state *s) const =0 |
Format the state as a string for printing. More... | |
virtual state * | project_state (const state *s, const const_twa_ptr &t) const |
Project a state on an automaton. More... | |
virtual bool | is_empty () const |
Check whether the language of the automaton is empty. More... | |
virtual twa_run_ptr | accepting_run () const |
Return an accepting run if one exists. More... | |
virtual twa_word_ptr | accepting_word () const |
Return an accepting word if one exists. More... | |
unsigned | num_sets () const |
Number of acceptance sets used by the automaton. More... | |
const acc_cond::acc_code & | get_acceptance () const |
Acceptance formula used by the automaton. More... | |
void | set_acceptance (unsigned num, const acc_cond::acc_code &c) |
Set the acceptance condition of the automaton. More... | |
void | copy_acceptance_of (const const_twa_ptr &a) |
Copy the acceptance condition of another TωA. More... | |
void | copy_ap_of (const const_twa_ptr &a) |
Copy the atomic propositions of another TωA. More... | |
void | set_generalized_buchi (unsigned num) |
Set generalized Büchi acceptance. More... | |
acc_cond::mark_t | set_buchi () |
Set Büchi acceptance. More... | |
void | set_named_prop (std::string s, void *val, std::function< void(void *)> destructor) |
Declare a named property. More... | |
template<typename T > | |
void | set_named_prop (std::string s, T *val) |
Declare a named property. More... | |
void | set_named_prop (std::string s, std::nullptr_t) |
Erase a named property. More... | |
template<typename T > | |
T * | get_named_prop (std::string s) const |
Retrieve a named property. More... | |
template<typename T > | |
T * | get_or_set_named_prop (std::string s) |
Create or retrieve a named property. More... | |
void | release_named_properties () |
Destroy all named properties. More... | |
trival | prop_state_acc () const |
Whether the automaton uses state-based acceptance. More... | |
void | prop_state_acc (trival val) |
Set the state-based-acceptance property. More... | |
trival | is_sba () const |
Whether this is a state-based Büchi automaton. More... | |
trival | prop_inherently_weak () const |
Whether the automaton is inherently weak. More... | |
void | prop_inherently_weak (trival val) |
Set the "inherently weak" proeprty. More... | |
trival | prop_terminal () const |
Whether the automaton is terminal. More... | |
void | prop_terminal (trival val) |
Set the terminal property. More... | |
trival | prop_weak () const |
Whether the automaton is weak. More... | |
void | prop_weak (trival val) |
Set the weak property. More... | |
trival | prop_deterministic () const |
Whether the automaton is deterministic. More... | |
void | prop_deterministic (trival val) |
Set the deterministic property. More... | |
trival | prop_unambiguous () const |
Whether the automaton is unambiguous. More... | |
void | prop_unambiguous (trival val) |
Sets the unambiguous property. More... | |
trival | prop_stutter_invariant () const |
Whether the automaton is stutter-invariant. More... | |
void | prop_stutter_invariant (trival val) |
Set the stutter-invariant property. More... | |
void | prop_copy (const const_twa_ptr &other, prop_set p) |
Copy the properties of another automaton. More... | |
void | prop_keep (prop_set p) |
Keep only a subset of properties of the current automaton. More... | |
int | register_ap (formula ap) |
Register an atomic proposition designated by ap. More... | |
int | register_ap (std::string ap) |
Register an atomic proposition designated by ap. More... | |
const acc_cond & | acc () const |
The acceptance condition of the automaton. More... | |
acc_cond & | acc () |
The acceptance condition of the automaton. More... | |
Protected Member Functions | |
tgta (const bdd_dict_ptr &d) | |
Protected Attributes | |
twa_succ_iterator * | iter_cache_ |
Any iterator returned via release_iter. More... | |
bdd_dict_ptr | dict_ |
BDD dictionary used by the automaton. More... | |
A Transition-based Generalized Testing Automaton (TGTA).
Transition-based Generalized Testing Automaton (TGTA) is a new kind of automaton that combines features from both TA and TGBA. From TA, we take the idea of labeling transitions with changesets, however we remove the use of livelock-acceptance (because it may require a two-pass emptiness check), and the implicit stuttering. From TGBA, we inherit the use of transition-based generalized acceptance conditions. The resulting Chimera, which we call "Transition-based Generalized Testing Automaton" (TGTA), accepts only stuttering-insensitive languages like TA, and inherits advantages from both TA and TGBA: it has a simple one-pass emptiness-check procedure (the same as algorithm the one for TGBA), and can benefit from reductions based on the stuttering of the properties pretty much like a TA. Livelock acceptance states, which are no longer supported are emulated using states with a Büchi accepting self-loop labeled by empty changeset.
Browsing such automaton can be achieved using two functions: get_initial_state
and succ_iter
. The former returns the initial state(s) while the latter lists the successor states of any state. A second implementation of succ_iter
returns only the successors reached through a changeset passed as a parameter.
Note that although this is a transition-based automata, we never represent transitions! Transition informations are obtained by querying the iterator over the successors of a state.
|
inlineinherited |
The acceptance condition of the automaton.
|
inlineinherited |
The acceptance condition of the automaton.
|
virtualinherited |
Return an accepting run if one exists.
Note that this method currently one works for Fin-less acceptance. For acceptance conditions that contain Fin acceptance, you can either rely on is_empty() and not use any accepting run, or remove Fin acceptance using remove_fin() and compute an accepting run on that larger automaton.
Return nullptr if no accepting run were found.
|
virtualinherited |
Return an accepting word if one exists.
Note that this method DO works with Fin acceptance.
Return nullptr if no accepting word were found.
|
inlineinherited |
The vector of atomic propositions registered by this automaton.
|
inlineinherited |
The set of atomic propositions as a conjunction.
|
inlineinherited |
Copy the acceptance condition of another TωA.
|
inlineinherited |
Copy the atomic propositions of another TωA.
|
pure virtualinherited |
Format the state as a string for printing.
Formating is the responsability of the automata that owns the state, so that state objects could be implemented as very small objects, maybe sharing data with other state objects via data structure stored in the automaton.
Implemented in spot::kripke_graph, spot::taa_tgba_labelled< label >, spot::taa_tgba_labelled< std::string >, spot::taa_tgba_labelled< formula >, spot::twa_product, and spot::tgta_explicit.
|
inlineinherited |
Acceptance formula used by the automaton.
|
inlineinherited |
Get the dictionary associated to the automaton.
Automata are labeled by Boolean formulas over atomic propositions. These Boolean formula are represented as BDDs. The dictionary allows to map BDD variables back to atomic propositions, and vice versa.
Usually automata that are involved in the same computations should share their dictionaries so that operations between BDDs of the two automata work naturally.
It is however possible to declare automata that use different sets of atomic propositions with different dictionaries. That way a BDD variable associated to some atomic proposition in one automaton might be reused for another atomic proposition in the other automaton.
|
pure virtualinherited |
Get the initial state of the automaton.
The state has been allocated with new
. It is the responsability of the caller to destroy
it when no longer needed.
Implemented in spot::kripke_graph, spot::twa_product_init, spot::twa_product, spot::taa_tgba, spot::tgta_explicit, and spot::tgta_product.
|
inlineinherited |
Retrieve a named property.
Because named property can be object of any type, retrieving the object requires knowing its type.
s | the name of the object to retrieve |
T | the type of the object to retrieve |
Note that the return is a pointer to T
, so the type should not include the pointer.
Returns a nullptr if no such named property exists.
See https://spot.lrde.epita.fr/concepts.html#named-properties for a list of named properties used by Spot.
|
inlineinherited |
Create or retrieve a named property.
Arbitrary objects can be attached to automata. Those are called named properties. They are used for instance to name all the state of an automaton.
This function create a property object of a given type, and attached it to name if not such property exist, or it returns
See https://spot.lrde.epita.fr/concepts.html#named-properties for a list of named properties used by Spot.
|
virtualinherited |
Check whether the language of the automaton is empty.
|
inlineinherited |
Whether this is a state-based Büchi automaton.
An SBA has a Büchi acceptance, and should have its state-based acceptance property set.
|
inlineinherited |
Number of acceptance sets used by the automaton.
|
virtualinherited |
Project a state on an automaton.
This converts s, into that corresponding spot::state for t. This is useful when you have the state of a product, and want restrict this state to a specific automata occuring in the product.
It goes without saying that s and t should be compatible (i.e., s is a state of t).
state*
(the projected state) that must be destroyed by the caller. Reimplemented in spot::twa_product.
|
inlineinherited |
Copy the properties of another automaton.
Copy the property speciefied with p from other to the current automaton.
There is no default value for p on purpose. This way any time we add a new property we have to update every call to prop_copy().
References spot::twa::prop_set::deterministic, spot::twa::prop_set::inherently_weak, spot::twa::prop_set::state_based, and spot::twa::prop_set::stutter_inv.
|
inlineinherited |
Whether the automaton is deterministic.
An automaton is deterministic if the conjunction between the labels of two transitions leaving a state is always false.
Note that this method may return trival::maybe() when it is unknown whether the automaton is deterministic or not. If you need a true/false answer, prefer the is_deterministic() function.
|
inlineinherited |
Set the deterministic property.
Setting the "deterministic" property automatically sets the "unambiguous" property.
|
inlineinherited |
Whether the automaton is inherently weak.
An automaton is inherently weak if accepting cycles and rejecting cycles are never mixed in the same strongly connected component.
|
inlineinherited |
Set the "inherently weak" proeprty.
Setting "inherently weak" to false automatically disables "terminal" and "weak".
|
inlineinherited |
Keep only a subset of properties of the current automaton.
All properties part of a group set to false
in p are reset to their default value of trival::maybe().
References spot::twa::prop_set::deterministic, spot::twa::prop_set::inherently_weak, spot::twa::prop_set::state_based, and spot::twa::prop_set::stutter_inv.
|
inlineinherited |
Whether the automaton uses state-based acceptance.
From the point of view of Spot, this means that all transitions leaving a state belong to the same acceptance sets. Then it is equivalent to pretend that the state is in the acceptance set.
|
inlineinherited |
Set the state-based-acceptance property.
If this property is set to true, then all transitions leaving a state must belong to the same acceptance sets.
|
inlineinherited |
Whether the automaton is stutter-invariant.
An automaton is stutter-invariant iff any accepted word remains accepted after removing a finite number of duplicate letters, or after duplicating finite number of letters.
Note that this method may return trival::maybe() when it is unknown whether the automaton is stutter-invariant or not. If you need a true/false answer, prefer one using of the the is_stutter_invariant() function.
|
inlineinherited |
Set the stutter-invariant property.
|
inlineinherited |
Whether the automaton is terminal.
An automaton is terminal if it is weak, no non-accepting cycle can be reached from an accepting cycle, and the accepting strongly components are complete (i.e., any suffix is accepted as soon as we enter an accepting component).
|
inlineinherited |
Set the terminal property.
Marking an automaton as "terminal" automatically marks it as "weak" and "inherently weak".
|
inlineinherited |
Whether the automaton is unambiguous.
An automaton is unambiguous if any accepted word is recognized by exactly one accepting path in the automaton. Any word (accepted or not) may be recognized by several rejecting paths in the automaton.
Note that this method may return trival::maybe() when it is unknown whether the automaton is unambiguous or not. If you need a true/false answer, prefer the is_unambiguous() function.
|
inlineinherited |
Sets the unambiguous property.
Marking an automaton as "non unambiguous" automatically marks it as "non deterministic".
|
inlineinherited |
Whether the automaton is weak.
An automaton is weak if inside each strongly connected component, all transitions belong to the same acceptance sets.
|
inlineinherited |
Set the weak property.
Marking an automaton as "weak" automatically marks it as "inherently weak". Marking an automaton as "not weak" automatically marks are as "not terminal".
|
inlineinherited |
Register an atomic proposition designated by ap.
This is the preferred way to declare that an automaton is using a given atomic proposition.
This adds the atomic proposition to the list of atomic proposition of the automaton, and also register it to the bdd_dict.
|
inlineinherited |
Register an atomic proposition designated by ap.
This is the preferred way to declare that an automaton is using a given atomic proposition.
This adds the atomic proposition to the list of atomic proposition of the automaton, and also register it to the bdd_dict.
References spot::formula::ap().
|
inlineinherited |
Register all atomic propositions that have already be register by the bdd_dict for this automaton.
This method may only be called on an automaton with an empty list of AP. It will fetch all atomic proposition that have been set in the bdd_dict for this particular automaton.
The typical use-case for this function is when the labels of an automaton are created by functions such as formula_to_bdd(). This is for instance done in the parser for never claims or LBTT.
|
inlineinherited |
Release an iterator after usage.
This iterator can then be reused by succ_iter() to avoid memory allocation.
|
inlineinherited |
Destroy all named properties.
This is used by the automaton destructor, but it could be used by any algorithm that want to get rid of all named properties.
|
inlineinherited |
Set the acceptance condition of the automaton.
num | the number of acceptance sets used |
c | the acceptance formula |
|
inlineinherited |
Set Büchi acceptance.
This declares a single acceptance set, and Inf(0)
acceptance. The returned mark {0}
can be used to tag accepting transition.
Note that this does not make the automaton as using state-based acceptance. If you want to create a Büchi automaton with state-based acceptance, call
in addition.
|
inlineinherited |
Set generalized Büchi acceptance.
num | the number of acceptance sets to used |
The acceptance formula of the form
is generated.
In the case where num is null, the state-acceptance property is automatically turned on.
|
inherited |
Declare a named property.
Arbitrary objects can be attached to automata. Those are called named properties. They are used for instance to name all the state of an automaton.
This function attaches the object val to the current automaton, under the name s and destroy any previous property with the same name.
When the automaton is destroyed, the destructor function will be called to destroy the attached object.
See https://spot.lrde.epita.fr/concepts.html#named-properties for a list of named properties used by Spot.
|
inlineinherited |
Declare a named property.
Arbitrary objects can be attached to automata. Those are called named properties. They are used for instance to name all the state of an automaton.
This function attaches the object val to the current automaton, under the name s and destroy any previous property with the same name.
When the automaton is destroyed, the attached object will be destroyed with delete
.
See https://spot.lrde.epita.fr/concepts.html#named-properties for a list of named properties used by Spot.
|
inherited |
Erase a named property.
Arbitrary objects can be attached to automata. Those are called named properties. They are used for instance to name all the state of an automaton.
This function removes the property s if it exists.
See https://spot.lrde.epita.fr/concepts.html#named-properties for a list of named properties used by Spot.
|
inlineinherited |
Build an iterable over the successors of s.
This is meant to be used as
and the above loop is in fact syntactic sugar for
|
pure virtualinherited |
Get an iterator over the successors of local_state.
The iterator has been allocated with new
. It is the responsability of the caller to delete
it when no longer needed.
Implemented in spot::kripke_graph, spot::twa_product, spot::taa_tgba, spot::tgta_explicit, and spot::tgta_product.
|
pure virtual |
Get an iterator over the successors of state filtred by the value of the changeset on transitions between the state and his successors.
The iterator has been allocated with new
. It is the responsability of the caller to delete
it when no longer needed.
Implemented in spot::tgta_explicit.
|
inherited |
Unregister an atomic proposition.
num | the BDD variable number returned by register_ap(). |
|
protectedinherited |
BDD dictionary used by the automaton.
|
mutableprotectedinherited |
Any iterator returned via release_iter.