mCRL2
|
A class that contains a labelled transition system. More...
#include <lts.h>
Public Types | |
typedef STATE_LABEL_T | state_label_t |
The type of state labels. | |
typedef ACTION_LABEL_T | action_label_t |
The type of action labels. | |
typedef LTS_BASE | base_t |
The type of the used lts base. | |
typedef std::vector< STATE_LABEL_T >::size_type | states_size_type |
The sort that contains the indices of states. | |
typedef std::vector< ACTION_LABEL_T >::size_type | labels_size_type |
The sort that represents the indices of labels. | |
typedef std::vector< transition >::size_type | transitions_size_type |
The sort that contains indices of transitions. | |
Public Member Functions | |
lts () | |
Creates an empty LTS. | |
lts (const lts &l) | |
Creates a copy of the supplied LTS. | |
lts & | operator= (const lts &l) |
Standard assignment operator. | |
bool | operator== (const lts &other) const |
Standard equality operator. | |
void | swap (lts &l) |
Swap this lts with the supplied supplied LTS. | |
states_size_type | num_states () const |
Gets the number of states of this LTS. | |
std::vector< STATE_LABEL_T > & | state_labels () |
Provides the state labels of an LTS. | |
const std::vector< STATE_LABEL_T > & | state_labels () const |
Provides the state labels of an LTS. | |
states_size_type | num_state_labels () const |
Gets the number of state labels of this LTS. | |
void | set_num_states (const states_size_type n, const bool has_state_labels=true) |
Sets the number of states of this LTS. | |
transitions_size_type | num_transitions () const |
Gets the number of transitions of this LTS. | |
void | set_num_action_labels (const labels_size_type n) |
Sets the number of action labels of this LTS. | |
labels_size_type | num_action_labels () const |
Gets the number of action labels of this LTS. | |
states_size_type | initial_state () const |
Gets the initial state number of this LTS. | |
void | set_initial_state (const states_size_type state) |
Sets the initial state number of this LTS. | |
states_size_type | add_state (const STATE_LABEL_T &label=STATE_LABEL_T()) |
Adds a state to this LTS. | |
labels_size_type | add_action (const ACTION_LABEL_T &label) |
Adds an action with a label to this LTS. | |
const labels_size_type | tau_label_index () const |
Provide the index of the label that represents tau. | |
void | set_state_label (const states_size_type state, const STATE_LABEL_T &label) |
Sets the label of a state. | |
const std::vector< ACTION_LABEL_T > & | action_labels () const |
The action labels in this lts. | |
void | set_action_label (const labels_size_type action, const ACTION_LABEL_T &label) |
Sets the label of an action. | |
const std::set< labels_size_type > & | hidden_label_set () const |
Returns the hidden label set that tells for each label what its corresponding hidden label is. | |
std::set< labels_size_type > & | hidden_label_set () |
Returns the hidden label set that tells for each label what its corresponding hidden label is. | |
void | set_hidden_label_set (const std::set< labels_size_type > &m) |
Sets the hidden label map that tells for each label what its corresponding hidden label is. | |
labels_size_type | apply_hidden_label_map (const labels_size_type action) const |
If the action label is registered hidden, it returns tau, otherwise the original label. | |
STATE_LABEL_T | state_label (const states_size_type state) const |
Gets the label of a state. | |
bool | is_probabilistic (const states_size_type state) const |
Gets the label of a state. | |
ACTION_LABEL_T | action_label (const labels_size_type action) const |
Gets the label of an action. | |
void | clear_transitions (const std::size_t n=0) |
Clear the transitions of an lts. | |
void | clear_actions () |
Clear the action labels of an lts. | |
void | clear_state_labels () |
Clear the labels of an lts. | |
void | clear () |
Clear the transitions system. | |
const std::vector< transition > & | get_transitions () const |
Gets a const reference to the vector of transitions of the current lts. | |
std::vector< transition > & | get_transitions () |
Gets a reference to the vector of transitions of the current lts. | |
void | add_transition (const transition &t) |
Add a transition to the lts. | |
bool | is_tau (labels_size_type action) const |
Checks whether an action is a tau action. | |
void | record_hidden_actions (const std::vector< std::string > &tau_actions) |
Records all actions with a string that occurs in tau_actions internally. | |
void | apply_hidden_actions (const std::vector< std::string > &tau_actions) |
Rename actions in the lts by hiding the actions in the vector tau_actions. | |
bool | has_state_info () const |
Checks whether this LTS has state values associated with its states. | |
bool | has_action_info () const |
Checks whether this LTS has labels associated with its actions, which are numbers. | |
Public Member Functions inherited from mcrl2::lts::lts_default_base | |
lts_type | type () |
Provides the type of this lts, in casu lts_none. | |
void | swap (lts_default_base &) |
Standard swap function. | |
bool | operator== (const lts_default_base &) const |
Standard equality function. | |
Static Public Attributes | |
static constexpr bool | is_probabilistic_lts =false |
An indicator that this is not a probabilistic lts. | |
Protected Member Functions | |
void | rename_labels (const std::map< labels_size_type, labels_size_type > &action_rename_map) |
void | store_action_label_to_be_renamed (const ACTION_LABEL_T &a, const labels_size_type i, std::map< labels_size_type, labels_size_type > &action_rename_map) |
Protected Attributes | |
states_size_type | m_nstates |
states_size_type | m_init_state |
std::vector< transition > | m_transitions |
std::vector< STATE_LABEL_T > | m_state_labels |
std::vector< ACTION_LABEL_T > | m_action_labels |
std::set< labels_size_type > | m_hidden_label_set |
A class that contains a labelled transition system.
The state labels and action labels can be any type. Essentially, a labelled transition system consists of a vector of transitions. Each transition is a triple of three numbers <from, label, to>. For these numbers, there can be associated state labels (for 'from' and 'to'), and action labels (for 'label'). But it is also possible, that no state or action labels are provided. For all action labels it is maintained whether this action label is an internal 'tau' action. This can be indicated for each action label separately. Finally, the number of states is recalled as a separate variable.
typedef ACTION_LABEL_T mcrl2::lts::lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE >::action_label_t |
typedef LTS_BASE mcrl2::lts::lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE >::base_t |
typedef std::vector<ACTION_LABEL_T>::size_type mcrl2::lts::lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE >::labels_size_type |
typedef STATE_LABEL_T mcrl2::lts::lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE >::state_label_t |
typedef std::vector<STATE_LABEL_T>::size_type mcrl2::lts::lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE >::states_size_type |
typedef std::vector<transition>::size_type mcrl2::lts::lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE >::transitions_size_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Adds a state to this LTS.
It is not checked whether the added state already exists.
[in] | label | The label of the state. If one state has a state label, all states must have state labels. If no state label is given, it must be the case that no state has a label. |
|
inline |
|
inline |
Rename actions in the lts by hiding the actions in the vector tau_actions.
Multiactions can be partially renamed. I.e. a|b becomes a if b is hidden. In such a case the new action a is mapped onto an existing action a; if such a label a does not exist, the action label a|b is renamed to a.
[in] | tau_actions | Vector with strings indicating which actions must be transformed to tau's |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Clear the transitions of an lts.
[in] | n | An optional parameter that indicates how many transitions are to be expected. This is used to set the reserved size of a vector, to prevent unnecessary resizing. |
This resets the transition vector in an lts, but leaves other related items, such as state or action labels untouched.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Records all actions with a string that occurs in tau_actions internally.
In case actions are partially hidden, e.g. action a is hidden in a|b b is the result. If b is an existing label with index j, and a|b had index i, every i is replaced by j. If there was no action b yet, the action label a|b is replaced by the action label b. Essential for the correctness is that hiding an action repeatedly in a multiaction, has the same effect as hiding it once, which is a property of hiding actions.
[in] | tau_actions | Vector with strings indicating which actions must be transformed to tau's |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |