mCRL2
Loading...
Searching...
No Matches
mcrl2::lts::detail::scc_partitioner< LTS_TYPE > Class Template Reference

This class contains an scc partitioner removing inert tau loops. More...

#include <liblts_scc.h>

Public Member Functions

 scc_partitioner (LTS_TYPE &l)
 Creates an scc partitioner for an LTS.
 
 ~scc_partitioner ()=default
 Destroys this partitioner.
 
void replace_transition_system (const bool preserve_divergence_loops)
 The lts for which this partioner is created is replaced by the lts modulo the calculated partition.
 
std::size_t num_eq_classes () const
 Gives the number of bisimulation equivalence classes of the LTS.
 
std::size_t get_eq_class (const std::size_t s) const
 Gives the equivalence class number of a state. The equivalence class numbers range from 0 upto (and excluding) num_eq_classes().
 
bool in_same_class (const std::size_t s, const std::size_t t) const
 Returns whether two states are in the same bisimulation equivalence class.
 

Private Types

typedef std::size_t state_type
 
typedef std::size_t label_type
 

Private Member Functions

void group_components (const state_type t, const state_type equivalence_class_index, const indexed_sorted_vector_for_tau_transitions< LTS_TYPE > &src_tgt_src, std::vector< bool > &visited)
 
void dfs_numbering (const state_type t, const indexed_sorted_vector_for_tau_transitions< LTS_TYPE > &src_tgt, std::vector< bool > &visited)
 

Private Attributes

LTS_TYPE & aut
 
std::vector< state_typeblock_index_of_a_state
 
std::vector< state_typedfsn2state
 
state_type equivalence_class_index
 

Detailed Description

template<class LTS_TYPE>
class mcrl2::lts::detail::scc_partitioner< LTS_TYPE >

This class contains an scc partitioner removing inert tau loops.

Definition at line 127 of file liblts_scc.h.

Member Typedef Documentation

◆ label_type

template<class LTS_TYPE >
typedef std::size_t mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::label_type
private

Definition at line 190 of file liblts_scc.h.

◆ state_type

template<class LTS_TYPE >
typedef std::size_t mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::state_type
private

Definition at line 189 of file liblts_scc.h.

Constructor & Destructor Documentation

◆ scc_partitioner()

template<class LTS_TYPE >
mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::scc_partitioner ( LTS_TYPE &  l)

Creates an scc partitioner for an LTS.

This scc partitioner calculates a partition of the state space of the transition system l using a straightforward algorithm found in A.V. Aho, J.E. Hopcroft and J.D. Ullman, Data structures and algorithms. Addison Wesley, 1987 on page 224. All states that reside on a loop of internal actions are put in the same equivalence class. The function l.is_tau is used to determine whether an action is internal. Partitioning is done immediately when an instance of this class is created. When applying the function replace_transition_system the automaton l is replaced by (aka shrinked to) the automaton modulo the calculated partition.

Parameters
[in]lreference to an LTS.

Definition at line 210 of file liblts_scc.h.

◆ ~scc_partitioner()

template<class LTS_TYPE >
mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::~scc_partitioner ( )
default

Destroys this partitioner.

Member Function Documentation

◆ dfs_numbering()

template<class LTS_TYPE >
void mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::dfs_numbering ( const state_type  t,
const indexed_sorted_vector_for_tau_transitions< LTS_TYPE > &  src_tgt,
std::vector< bool > &  visited 
)
private

Definition at line 341 of file liblts_scc.h.

◆ get_eq_class()

template<class LTS_TYPE >
std::size_t mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::get_eq_class ( const std::size_t  s) const

Gives the equivalence class number of a state. The equivalence class numbers range from 0 upto (and excluding) num_eq_classes().

Parameters
[in]sA state number.
Returns
The number of the equivalence class to which s belongs.

Definition at line 307 of file liblts_scc.h.

◆ group_components()

template<class LTS_TYPE >
void mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::group_components ( const state_type  t,
const state_type  equivalence_class_index,
const indexed_sorted_vector_for_tau_transitions< LTS_TYPE > &  src_tgt_src,
std::vector< bool > &  visited 
)
private

Definition at line 321 of file liblts_scc.h.

◆ in_same_class()

template<class LTS_TYPE >
bool mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::in_same_class ( const std::size_t  s,
const std::size_t  t 
) const

Returns whether two states are in the same bisimulation equivalence class.

Parameters
[in]sA state number.
[in]tA state number.
Return values
trueif s and t are in the same bisimulation equivalence class;
falseotherwise.

Definition at line 313 of file liblts_scc.h.

◆ num_eq_classes()

template<class LTS_TYPE >
std::size_t mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::num_eq_classes

Gives the number of bisimulation equivalence classes of the LTS.

Returns
The number of bisimulation equivalence classes of the LTS.

Definition at line 301 of file liblts_scc.h.

◆ replace_transition_system()

template<class LTS_TYPE >
void mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::replace_transition_system ( const bool  preserve_divergence_loops)

The lts for which this partioner is created is replaced by the lts modulo the calculated partition.

The number of states of the new lts becomes the number of equivalence classes. In each transition the start and end state are replaced by its equivalence class. If a transition has a tau label (which is checked using the function l.is_tau) then it is preserved if either from and to state are different, or preserve_divergence_loops is true. All non tau transitions are always preserved. The label numbers for preserved transitions are not changed.

Parameters
[in]preserve_divergence_loopsIf true preserve a tau loop on states that were part of a larger tau loop in the input transition system. Otherwise idle tau loops are removed.

Definition at line 248 of file liblts_scc.h.

Member Data Documentation

◆ aut

template<class LTS_TYPE >
LTS_TYPE& mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::aut
private

Definition at line 192 of file liblts_scc.h.

◆ block_index_of_a_state

template<class LTS_TYPE >
std::vector< state_type > mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::block_index_of_a_state
private

Definition at line 194 of file liblts_scc.h.

◆ dfsn2state

template<class LTS_TYPE >
std::vector< state_type > mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::dfsn2state
private

Definition at line 195 of file liblts_scc.h.

◆ equivalence_class_index

template<class LTS_TYPE >
state_type mcrl2::lts::detail::scc_partitioner< LTS_TYPE >::equivalence_class_index
private

Definition at line 196 of file liblts_scc.h.


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