mcrl2::lps::state_data_type

Include file:

#include "mcrl2/lps/ltsmin.h
class mcrl2::lps::state_data_type

Models the mapping of mCRL2 state values to integers.

Protected attributes

std::string mcrl2::lps::state_data_type::m_name
data::sort_expression mcrl2::lps::state_data_type::m_sort

Protected member functions

std::size_t expression2index(const data::data_expression &x)
data::data_expression index2expression(std::size_t i) const

Public member functions

std::size_t deserialize(const std::string &s) override

Deserializes a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.

Returns: The index of the data value. exception * <std::runtime_error> { if deserialization failed }

std::vector<std::string> generate_values(std::size_t max_size) const override

Generates possible values of the data type (at most max_size).

const std::string &name() const override

Returns the name of the data type.

std::size_t parse(const std::string &s) override

Parses a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.

Returns: The index of the data value. exception * <std::runtime_error> { if parsing failed }

std::string print(int i) const override

Returns a human readable representation of the value with index i. N.B. It is not guaranteed that parse(print(i)) == i.

Pre: i is a valid index

std::string serialize(int i) const override

Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deserialize(i)) == i.

Pre: i is a valid index

state_data_type(const data::data_specification &data, const process::action_label_list &action_labels, const data::sort_expression &sort, bool sort_is_finite)