mCRL2
Loading...
Searching...
No Matches
mcrl2::lps::pins Class Reference

#include <ltsmin.h>

Public Types

enum class  guard_evaluation_t { GUARD_FALSE = 0 , GUARD_TRUE = 1 , GUARD_MAYBE = 2 }
 guard evaluations have ternary logic. A guard may not always rewrite to true or false More...
 
using ltsmin_state_type = int *
 
using substitution_t = data::rewriter::substitution_type
 
using datatype_index = std::size_t
 

Public Member Functions

std::size_t process_parameter_count () const
 Returns the number of process parameters of the LPS.
 
std::size_t group_count () const
 Returns the number of available groups. This equals the number of action summands of the LPS.
 
lps::specification reduce_specification (const lps::specification &spec)
 extracts all guards from the original specification and returns a new one with the guards removed.
 
 pins (const std::string &filename, const std::string &rewriter_strategy)
 Constructor.
 
std::size_t datatype_count () const
 Returns the number of unique datatype maps. Note that the datatype map for action labels is included, so this number equals the number of different process parameter types + 1.
 
pins_data_type & data_type (std::size_t i)
 Returns a reference to the datatype map with index i.
 
const std::vector< std::size_t > & read_group (std::size_t index) const
 Indices of process parameters that influence event or next state of a summand by being read.
 
const std::vector< std::size_t > & write_group (std::size_t index) const
 Indices of process parameters that influence event or next state of a summand by being written.
 
const std::vector< std::size_t > & update_group (std::size_t index) const
 Indices of process parameters that influence event or next state of a summand by being read except from the guards.
 
const std::vector< std::size_t > & guard_parameters (std::size_t index) const
 
const std::vector< std::size_t > & guard_info (std::size_t index) const
 
std::size_t guard_count () const
 
const std::string & guard_name (std::size_t index)
 
std::string process_parameter_name (std::size_t i) const
 Returns a human-readable, unique name for process parameter i.
 
datatype_index process_parameter_type (std::size_t i) const
 Returns the datatype map index corresponding to process parameter i.
 
std::size_t edge_label_count () const
 Returns the number of labels per edge.
 
datatype_index edge_label_type (std::size_t) const
 Returns the datatype map index corresponding to edge label i.
 
std::string edge_label_name (std::size_t) const
 Returns the name of the i-th action label (always "action").
 
void get_initial_state (ltsmin_state_type &s)
 Assigns the initial state to s.
 
std::set< std::string > summand_action_names (std::size_t i) const
 Returns the names of the actions that appear in the summand with index i, with 0 <= i < group_count().
 
template<typename StateFunction >
void next_state_all (ltsmin_state_type const &src, StateFunction &f, ltsmin_state_type const &dest, int *const &labels)
 Iterates over the 'next states' of state src, and invokes a callback function for each discovered state.
 
template<typename StateFunction >
void next_state_long (ltsmin_state_type const &src, std::size_t group, StateFunction &f, ltsmin_state_type const &dest, int *const &labels)
 
template<typename StateFunction >
void update_long (ltsmin_state_type const &src, std::size_t group, StateFunction &f, ltsmin_state_type const &dest, int *const &labels)
 
template<typename StateFunction >
void _long (ltsmin_state_type const &src, std::size_t group, StateFunction &f, const ltsmin_state_type &dest, int *const &labels, generator_type *generator)
 Iterates over the 'next states' of a particular summand of state src that are generated by a group of summands, and invokes a callback function for each discovered state.
 
guard_evaluation_t eval_guard_long (ltsmin_state_type const &src, std::size_t guard)
 
std::string info ()
 Prints an overview of several relevant attributes.
 

Static Public Member Functions

static lps::specification load_specification (const std::string &filename)
 

Protected Types

using generator_type = lps::explorer< false, false, lps::specification >
 

Protected Member Functions

pins_data_type & action_label_type_map ()
 Returns the action data type.
 
const pins_data_type & action_label_type_map () const
 Returns the action data type.
 
pins_data_type & state_type_map (std::size_t i)
 Returns the data type of the i-th state parameter.
 
const pins_data_type & state_type_map (std::size_t i) const
 Returns the data type of the i-th state parameter.
 
const linear_process & process () const
 Returns the process of the LPS specification.
 
const linear_process & process_reduced () const
 Returns the reduced process of the LPS specification, i.e. with conditions with guards removed.
 
const data::data_specification & data () const
 Returns the data specification of the LPS specification.
 
template<typename Iter >
std::string print_vector (Iter first, Iter last) const
 
template<typename Container >
std::string print_vector (const Container &c) const
 
void initialize_read_write_groups ()
 

Protected Attributes

std::size_t m_group_count = 0UL
 
std::size_t m_state_length = 0UL
 
std::vector< std::vector< std::size_t > > m_read_group
 
std::vector< std::vector< std::size_t > > m_write_group
 
std::vector< std::vector< std::size_t > > m_update_group
 
lps::specification m_specification
 
data::rewriter m_rewriter
 
generator_type m_generator
 
std::vector< data::variable > m_parameters_list
 
std::vector< std::string > m_process_parameter_names
 
utilities::indexed_set< atermpp::aterm > m_guards
 
std::vector< std::vector< std::size_t > > guard_parameters_list
 
std::vector< std::vector< std::size_t > > m_guard_info
 
std::vector< std::string > m_guard_names
 
lps::specification m_specification_reduced
 
data::rewriter m_rewriter_reduced
 
generator_type m_generator_reduced
 
std::vector< pins_data_type * > m_data_types
 
std::vector< std::unique_ptr< pins_data_type > > m_unique_data_types
 The unique type mappings; owns the data types that m_data_types refers to.
 
std::vector< std::size_t > m_unique_data_type_index
 

Detailed Description

Definition at line 315 of file ltsmin.h.

Member Typedef Documentation

◆ datatype_index

using mcrl2::lps::pins::datatype_index = std::size_t

the index type for datatype maps

Definition at line 540 of file ltsmin.h.

◆ generator_type

Definition at line 333 of file ltsmin.h.

◆ ltsmin_state_type

the state type used by LTSMin

Definition at line 318 of file ltsmin.h.

◆ substitution_t

Member Enumeration Documentation

◆ guard_evaluation_t

guard evaluations have ternary logic. A guard may not always rewrite to true or false

Enumerator
GUARD_FALSE 
GUARD_TRUE 
GUARD_MAYBE 

Definition at line 322 of file ltsmin.h.

Constructor & Destructor Documentation

◆ pins()

mcrl2::lps::pins::pins ( const std::string &  filename,
const std::string &  rewriter_strategy 
)
inline

Constructor.

Parameters
filenameThe name of a file containing an mCRL2 specification
rewriter_strategyThe rewriter strategy used for generating next states

Definition at line 669 of file ltsmin.h.

Member Function Documentation

◆ _long()

template<typename StateFunction >
void mcrl2::lps::pins::_long ( ltsmin_state_type const &  src,
std::size_t  group,
StateFunction &  f,
const ltsmin_state_type &  dest,
int *const &  labels,
generator_type *  generator 
)
inline

Iterates over the 'next states' of a particular summand of state src that are generated by a group of summands, and invokes a callback function for each discovered state.

StateFunction is a callback function that must provide the function operator() with the following interface: void operator()(ltsmin_state_type const& next_state, int* const& edge_labels, int group); where

  • next_state is the target state of the transition
  • edge_labels is an array of edge labels
  • group is the number of the summand from which the next state was generated, or -1 if it is unknown which summand
Parameters
srcAn LTSMin state.
groupthe number of the summand.
fA state function.
destA destination state, which is modified and passed to the callback. Must provide space for at least process_parameter_count() items.
labelsAn array of labels, which is modified and passed to the callback. Must provide space for at least edge_label_count() items.
generatorThe next state generator to use.

Definition at line 906 of file ltsmin.h.

◆ action_label_type_map() [1/2]

pins_data_type & mcrl2::lps::pins::action_label_type_map ( )
inlineprotected

Returns the action data type.

Definition at line 364 of file ltsmin.h.

◆ action_label_type_map() [2/2]

const pins_data_type & mcrl2::lps::pins::action_label_type_map ( ) const
inlineprotected

Returns the action data type.

Definition at line 370 of file ltsmin.h.

◆ data()

const data::data_specification & mcrl2::lps::pins::data ( ) const
inlineprotected

Returns the data specification of the LPS specification.

Definition at line 401 of file ltsmin.h.

◆ data_type()

pins_data_type & mcrl2::lps::pins::data_type ( std::size_t  i)
inline

Returns a reference to the datatype map with index i.

Precondition
0 <= i < datatype_count()

Definition at line 728 of file ltsmin.h.

◆ datatype_count()

std::size_t mcrl2::lps::pins::datatype_count ( ) const
inline

Returns the number of unique datatype maps. Note that the datatype map for action labels is included, so this number equals the number of different process parameter types + 1.

Definition at line 721 of file ltsmin.h.

◆ edge_label_count()

std::size_t mcrl2::lps::pins::edge_label_count ( ) const
inline

Returns the number of labels per edge.

Definition at line 794 of file ltsmin.h.

◆ edge_label_name()

std::string mcrl2::lps::pins::edge_label_name ( std::size_t  ) const
inline

Returns the name of the i-th action label (always "action").

Precondition
0 <= i < edge_label_count()

Definition at line 808 of file ltsmin.h.

◆ edge_label_type()

datatype_index mcrl2::lps::pins::edge_label_type ( std::size_t  ) const
inline

Returns the datatype map index corresponding to edge label i.

Precondition
0 <= i < edge_label_count()

Definition at line 801 of file ltsmin.h.

◆ eval_guard_long()

guard_evaluation_t mcrl2::lps::pins::eval_guard_long ( ltsmin_state_type const &  src,
std::size_t  guard 
)
inline

Definition at line 935 of file ltsmin.h.

◆ get_initial_state()

void mcrl2::lps::pins::get_initial_state ( ltsmin_state_type &  s)
inline

Assigns the initial state to s.

Definition at line 814 of file ltsmin.h.

◆ group_count()

std::size_t mcrl2::lps::pins::group_count ( ) const
inline

Returns the number of available groups. This equals the number of action summands of the LPS.

Definition at line 549 of file ltsmin.h.

◆ guard_count()

std::size_t mcrl2::lps::pins::guard_count ( ) const
inline

Definition at line 771 of file ltsmin.h.

◆ guard_info()

const std::vector< std::size_t > & mcrl2::lps::pins::guard_info ( std::size_t  index) const
inline

Definition at line 766 of file ltsmin.h.

◆ guard_name()

const std::string & mcrl2::lps::pins::guard_name ( std::size_t  index)
inline

Definition at line 776 of file ltsmin.h.

◆ guard_parameters()

const std::vector< std::size_t > & mcrl2::lps::pins::guard_parameters ( std::size_t  index) const
inline

Definition at line 761 of file ltsmin.h.

◆ info()

std::string mcrl2::lps::pins::info ( )
inline

Prints an overview of several relevant attributes.

Definition at line 959 of file ltsmin.h.

◆ initialize_read_write_groups()

void mcrl2::lps::pins::initialize_read_write_groups ( )
inlineprotected

Definition at line 429 of file ltsmin.h.

◆ load_specification()

static lps::specification mcrl2::lps::pins::load_specification ( const std::string &  filename)
inlinestatic

Definition at line 554 of file ltsmin.h.

◆ next_state_all()

template<typename StateFunction >
void mcrl2::lps::pins::next_state_all ( ltsmin_state_type const &  src,
StateFunction &  f,
ltsmin_state_type const &  dest,
int *const &  labels 
)
inline

Iterates over the 'next states' of state src, and invokes a callback function for each discovered state.

StateFunction is a callback function that must provide the function operator() with the following interface: void operator()(ltsmin_state_type const& next_state, int* const& edge_labels, int group=-1); where

  • next_state is the target state of the transition
  • edge_labels is an array of edge labels
  • group is the number of the summand from which the next state was generated, or -1 if it is unknown which summand
Parameters
srcAn LTSMin state
fA 'callback' function object
destA destination state, which is modified and passed to the callback. Must provide space for at least process_parameter_count() items.
labelsAn array of labels, which is modified and passed to the callback. Must provide space for at least edge_label_count() items.

Definition at line 851 of file ltsmin.h.

◆ next_state_long()

template<typename StateFunction >
void mcrl2::lps::pins::next_state_long ( ltsmin_state_type const &  src,
std::size_t  group,
StateFunction &  f,
ltsmin_state_type const &  dest,
int *const &  labels 
)
inline

Definition at line 875 of file ltsmin.h.

◆ print_vector() [1/2]

template<typename Container >
std::string mcrl2::lps::pins::print_vector ( const Container &  c) const
inlineprotected

Definition at line 424 of file ltsmin.h.

◆ print_vector() [2/2]

template<typename Iter >
std::string mcrl2::lps::pins::print_vector ( Iter  first,
Iter  last 
) const
inlineprotected

Definition at line 407 of file ltsmin.h.

◆ process()

const linear_process & mcrl2::lps::pins::process ( ) const
inlineprotected

Returns the process of the LPS specification.

Definition at line 388 of file ltsmin.h.

◆ process_parameter_count()

std::size_t mcrl2::lps::pins::process_parameter_count ( ) const
inline

Returns the number of process parameters of the LPS.

Definition at line 543 of file ltsmin.h.

◆ process_parameter_name()

std::string mcrl2::lps::pins::process_parameter_name ( std::size_t  i) const
inline

Returns a human-readable, unique name for process parameter i.

Definition at line 781 of file ltsmin.h.

◆ process_parameter_type()

datatype_index mcrl2::lps::pins::process_parameter_type ( std::size_t  i) const
inline

Returns the datatype map index corresponding to process parameter i.

Precondition
0 <= i < process_parameter_count()

Definition at line 788 of file ltsmin.h.

◆ process_reduced()

const linear_process & mcrl2::lps::pins::process_reduced ( ) const
inlineprotected

Returns the reduced process of the LPS specification, i.e. with conditions with guards removed.

Definition at line 395 of file ltsmin.h.

◆ read_group()

const std::vector< std::size_t > & mcrl2::lps::pins::read_group ( std::size_t  index) const
inline

Indices of process parameters that influence event or next state of a summand by being read.

Parameters
[in]indexthe selected summand
Returns
reference to a vector of indices of parameters
Precondition
0 <= i < group_count()

Definition at line 738 of file ltsmin.h.

◆ reduce_specification()

lps::specification mcrl2::lps::pins::reduce_specification ( const lps::specification &  spec)
inline

extracts all guards from the original specification and returns a new one with the guards removed.

Definition at line 563 of file ltsmin.h.

◆ state_type_map() [1/2]

pins_data_type & mcrl2::lps::pins::state_type_map ( std::size_t  i)
inlineprotected

Returns the data type of the i-th state parameter.

Definition at line 376 of file ltsmin.h.

◆ state_type_map() [2/2]

const pins_data_type & mcrl2::lps::pins::state_type_map ( std::size_t  i) const
inlineprotected

Returns the data type of the i-th state parameter.

Definition at line 382 of file ltsmin.h.

◆ summand_action_names()

std::set< std::string > mcrl2::lps::pins::summand_action_names ( std::size_t  i) const
inline

Returns the names of the actions that appear in the summand with index i, with 0 <= i < group_count().

Definition at line 825 of file ltsmin.h.

◆ update_group()

const std::vector< std::size_t > & mcrl2::lps::pins::update_group ( std::size_t  index) const
inline

Indices of process parameters that influence event or next state of a summand by being read except from the guards.

Parameters
[in]indexthe selected summand
Returns
reference to a vector of indices of parameters
Precondition
0 <= i < group_count()

Definition at line 756 of file ltsmin.h.

◆ update_long()

template<typename StateFunction >
void mcrl2::lps::pins::update_long ( ltsmin_state_type const &  src,
std::size_t  group,
StateFunction &  f,
ltsmin_state_type const &  dest,
int *const &  labels 
)
inline

Definition at line 881 of file ltsmin.h.

◆ write_group()

const std::vector< std::size_t > & mcrl2::lps::pins::write_group ( std::size_t  index) const
inline

Indices of process parameters that influence event or next state of a summand by being written.

Parameters
[in]indexthe selected summand
Returns
reference to a vector of indices of parameters
Precondition
0 <= i < group_count()

Definition at line 747 of file ltsmin.h.

Member Data Documentation

◆ guard_parameters_list

std::vector<std::vector<std::size_t> > mcrl2::lps::pins::guard_parameters_list
protected

Definition at line 341 of file ltsmin.h.

◆ m_data_types

std::vector<pins_data_type*> mcrl2::lps::pins::m_data_types
protected

Definition at line 355 of file ltsmin.h.

◆ m_generator

generator_type mcrl2::lps::pins::m_generator
protected

Definition at line 335 of file ltsmin.h.

◆ m_generator_reduced

generator_type mcrl2::lps::pins::m_generator_reduced
protected

Definition at line 349 of file ltsmin.h.

◆ m_group_count

std::size_t mcrl2::lps::pins::m_group_count = 0UL
protected

Definition at line 327 of file ltsmin.h.

◆ m_guard_info

std::vector<std::vector<std::size_t> > mcrl2::lps::pins::m_guard_info
protected

Definition at line 342 of file ltsmin.h.

◆ m_guard_names

std::vector<std::string> mcrl2::lps::pins::m_guard_names
protected

Definition at line 343 of file ltsmin.h.

◆ m_guards

utilities::indexed_set<atermpp::aterm> mcrl2::lps::pins::m_guards
protected

Definition at line 340 of file ltsmin.h.

◆ m_parameters_list

std::vector<data::variable> mcrl2::lps::pins::m_parameters_list
protected

Definition at line 337 of file ltsmin.h.

◆ m_process_parameter_names

std::vector<std::string> mcrl2::lps::pins::m_process_parameter_names
protected

Definition at line 338 of file ltsmin.h.

◆ m_read_group

std::vector<std::vector<std::size_t> > mcrl2::lps::pins::m_read_group
protected

Definition at line 329 of file ltsmin.h.

◆ m_rewriter

data::rewriter mcrl2::lps::pins::m_rewriter
protected

Definition at line 334 of file ltsmin.h.

◆ m_rewriter_reduced

data::rewriter mcrl2::lps::pins::m_rewriter_reduced
protected

Definition at line 348 of file ltsmin.h.

◆ m_specification

lps::specification mcrl2::lps::pins::m_specification
protected

Definition at line 332 of file ltsmin.h.

◆ m_specification_reduced

lps::specification mcrl2::lps::pins::m_specification_reduced
protected

Definition at line 347 of file ltsmin.h.

◆ m_state_length

std::size_t mcrl2::lps::pins::m_state_length = 0UL
protected

the number of process parameters

Definition at line 328 of file ltsmin.h.

◆ m_unique_data_type_index

std::vector<std::size_t> mcrl2::lps::pins::m_unique_data_type_index
protected

Definition at line 361 of file ltsmin.h.

◆ m_unique_data_types

std::vector<std::unique_ptr<pins_data_type> > mcrl2::lps::pins::m_unique_data_types
protected

The unique type mappings; owns the data types that m_data_types refers to.

Definition at line 358 of file ltsmin.h.

◆ m_update_group

std::vector<std::vector<std::size_t> > mcrl2::lps::pins::m_update_group
protected

Definition at line 331 of file ltsmin.h.

◆ m_write_group

std::vector<std::vector<std::size_t> > mcrl2::lps::pins::m_write_group
protected

Definition at line 330 of file ltsmin.h.


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