12#ifndef MCRL2_PBES_DETAIL_LTS2PBES_LTS_H
13#define MCRL2_PBES_DETAIL_LTS2PBES_LTS_H
15#include "mcrl2/lts/lts_lts.h"
26 const auto& action_labels = ltsspec.action_labels();
27 out <<
"LTS" << std::endl;
28 for (
const auto& tr: ltsspec.get_transitions())
30 out << tr.from() <<
" --" << action_labels[tr.label()] <<
"--> " << tr.to() << std::endl;
44 edge(label_type label_, state_type state_, std::size_t index_)
66 const auto& transitions = ltsspec.get_transitions();
67 for (std::size_t i = 0; i < transitions.size(); i++)
69 const auto& transition = transitions[i];
70 state_type s = transition.from();
71 label_type a = transition.label();
72 state_type t = transition.to();
73 m_state_map[s].emplace_back(a, t, i);
76 for (
const auto& a: ltsspec.action_labels())
78 m_action_labels.emplace_back(a.actions(), a.time());
80 m_state_count = ltsspec.num_states();
86 auto i = m_state_map.find(s);
87 if (i == m_state_map.end())
89 return m_empty_edge_list;
99 return m_action_labels;
104 return m_state_count;
115 const auto& action_labels = ltsspec.action_labels();
116 out <<
"pbes-LTS" << std::endl;
117 for (
const auto& p: ltsspec.state_map())
119 for (
const auto& edge: p.second)
121 out << edge.index <<
" " << p.first <<
" --" << action_labels[edge.label] <<
"--> " << edge.state << std::endl;
This class contains labelled transition systems in .lts format.
lts2pbes_lts(const lts::lts_lts_t <sspec)
const std::map< state_type, edge_list > & state_map() const
std::size_t state_count() const
const edge_list & edges(state_type s) const
std::vector< lps::multi_action > m_action_labels
std::map< state_type, edge_list > m_state_map
std::size_t m_state_count
const std::vector< lps::multi_action > & action_labels() const
edge_list m_empty_edge_list
std::ostream & operator<<(std::ostream &out, const lts2pbes_lts <sspec)
std::ostream & operator<<(std::ostream &out, const lts::lts_lts_t <sspec)
edge(label_type label_, state_type state_, std::size_t index_)