18#ifndef MCRL2_LTS_LTS_H
19#define MCRL2_LTS_LTS_H
81template <
class STATE_LABEL_T,
class ACTION_LABEL_T,
class LTS_BASE = lts_default_base>
82class lts:
public LTS_BASE
127 void rename_labels(
const std::map<labels_size_type, labels_size_type>& action_rename_map)
129 if (action_rename_map.size()>0)
133 auto i = action_rename_map.find(t.label());
134 if (i!=action_rename_map.end())
148 std::map<labels_size_type, labels_size_type>& action_rename_map)
157 action_rename_map[i]=j;
196 static_cast<LTS_BASE&
>(*this)=l;
211 return static_cast<const LTS_BASE&
>(*this)==
static_cast<const LTS_BASE&
>(other) &&
224 static_cast<LTS_BASE&
>(*this).swap(
static_cast<LTS_BASE&
>(l));
239 assert(l.m_action_labels.size()>0 && l.m_action_labels[
const_tau_label_index]==ACTION_LABEL_T::tau_action());
283 if (has_state_labels)
349 if (
label!=STATE_LABEL_T())
363 if (
label==ACTION_LABEL_T::tau_action())
572 if (tau_actions.size()==0)
577 std::map<labels_size_type, labels_size_type> action_rename_map;
581 a.hide_actions(tau_actions);
582 if (a==ACTION_LABEL_T::tau_action())
611 if (tau_actions.size()==0)
616 std::map<labels_size_type, labels_size_type> action_rename_map;
620 a.hide_actions(tau_actions);
623 b.hide_actions(tau_actions);
Read-only balanced binary tree of terms.
void swap(lts_default_base &)
Standard swap function.
lts_type type()
Provides the type of this lts, in casu lts_none.
bool operator==(const lts_default_base &) const
Standard equality function.
A class that contains a labelled transition system.
states_size_type num_state_labels() const
Gets the number of state labels of this LTS.
labels_size_type num_action_labels() const
Gets the number of action labels of this LTS.
states_size_type m_init_state
void add_transition(const transition &t)
Add a transition to the lts.
void set_num_action_labels(const labels_size_type n)
Sets the number of action labels of this LTS.
bool has_action_info() const
Checks whether this LTS has labels associated with its actions, which are numbers.
bool is_tau(labels_size_type action) const
Checks whether an action is a tau action.
std::set< labels_size_type > & hidden_label_set()
Returns the hidden label set that tells for each label what its corresponding hidden label is.
states_size_type num_states() const
Gets the number of states of this LTS.
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.
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 set_num_states(const states_size_type n, const bool has_state_labels=true)
Sets the number of states of this LTS.
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)
static constexpr bool is_probabilistic_lts
An indicator that this is not a probabilistic lts.
bool is_probabilistic(const states_size_type state) const
Gets the label of a state.
ACTION_LABEL_T action_label_t
The type of action labels.
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::vector< transition > m_transitions
std::vector< STATE_LABEL_T > & state_labels()
Provides the state labels of an LTS.
ACTION_LABEL_T action_label(const labels_size_type action) const
Gets the label of an action.
const labels_size_type tau_label_index() const
Provide the index of the label that represents tau.
const std::vector< ACTION_LABEL_T > & action_labels() const
The action labels in this lts.
bool has_state_info() const
Checks whether this LTS has state values associated with its states.
lts(const lts &l)
Creates a copy of the supplied LTS.
void set_initial_state(const states_size_type state)
Sets the initial state number of this LTS.
void set_action_label(const labels_size_type action, const ACTION_LABEL_T &label)
Sets the label of an action.
void rename_labels(const std::map< labels_size_type, labels_size_type > &action_rename_map)
std::set< labels_size_type > m_hidden_label_set
std::vector< STATE_LABEL_T >::size_type states_size_type
The sort that contains the indices of states.
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.
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.
std::vector< transition > & get_transitions()
Gets a reference to the vector of transitions of the current lts.
std::vector< ACTION_LABEL_T >::size_type labels_size_type
The sort that represents the indices of labels.
lts & operator=(const lts &l)
Standard assignment operator.
const std::vector< STATE_LABEL_T > & state_labels() const
Provides the state labels of an LTS.
std::vector< STATE_LABEL_T > m_state_labels
STATE_LABEL_T state_label(const states_size_type state) const
Gets the label of a state.
states_size_type add_state(const STATE_LABEL_T &label=STATE_LABEL_T())
Adds a state to this LTS.
STATE_LABEL_T state_label_t
The type of state labels.
void clear()
Clear the transitions system.
lts()
Creates an empty LTS.
bool operator==(const lts &other) const
Standard equality operator.
states_size_type m_nstates
const std::vector< transition > & get_transitions() const
Gets a const reference to the vector of transitions of the current lts.
LTS_BASE base_t
The type of the used lts base.
std::vector< transition >::size_type transitions_size_type
The sort that contains indices of transitions.
states_size_type initial_state() const
Gets the initial state number of this LTS.
void clear_state_labels()
Clear the labels of an lts.
void swap(lts &l)
Swap this lts with the supplied supplied LTS.
void record_hidden_actions(const std::vector< std::string > &tau_actions)
Records all actions with a string that occurs in tau_actions internally.
std::vector< ACTION_LABEL_T > m_action_labels
transitions_size_type num_transitions() const
Gets the number of transitions of this LTS.
void set_state_label(const states_size_type state, const STATE_LABEL_T &label)
Sets the label of a state.
labels_size_type add_action(const ACTION_LABEL_T &label)
Adds an action with a label to this LTS.
A class containing triples, source label and target representing transitions.
The file containing the types of labelled transition systems.
atermpp::term_balanced_tree< data::data_expression > state
lts_type
The enumerated type lts_type contains an index for every type type of labelled transition system that...
std::size_t label(const outgoing_pair_t &p)
Label of a pair of a label and target state.
static const std::size_t const_tau_label_index
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
A header file defining a transition as a triple from,label,to.