mCRL2
Loading...
Searching...
No Matches
transition.h
Go to the documentation of this file.
1// Author(s): Muck van Weerdenburg, Jan Friso Groote
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
17#ifndef MCRL2_LTS_TRANSITION_H
18#define MCRL2_LTS_TRANSITION_H
19
20#include <functional>
21
22namespace mcrl2
23{
24namespace lts
25{
26
27static const std::size_t const_tau_label_index=0;
28
34{
37};
38
43{
44 public:
46 typedef std::size_t size_type;
47
48 private:
52
53 public:
54 // There is no default constructor
55 transition() = delete;
56
58 transition(const std::size_t f,
59 const std::size_t l,
60 const std::size_t t):m_from(f),m_label(l),m_to(t)
61 {}
62
64 transition(const transition& t) = default;
65
67 transition(transition&& t) = default;
68
70 transition& operator=(const transition& t) = default;
71
74
77 from() const
78 {
79 return m_from;
80 }
81
84 {
85 return m_label;
86 }
87
90 to() const
91 {
92 return m_to;
93 }
94
96 void
98 {
99 m_from = from;
100 }
101
103 void
105 {
106 m_label = label;
107 }
108
110 void
112 {
113 m_to = to;
114 }
115
117 bool
118 operator ==(const transition& t) const
119 {
120 return m_from == t.m_from && m_label == t.m_label && m_to == t.m_to;
121 }
122
124 bool
125 operator !=(const transition& t) const
126 {
127 return !(*this==t);
128 }
129
134 bool
135 operator <(const transition& t) const
136 {
137 return m_from < t.m_from || (m_from == t.m_from && (m_label
138 < t.m_label || (m_label == t.m_label && m_to < t.m_to)));
139 }
140};
141
142} // namespace lts
143} // namespace mcrl2
144
145namespace std
146{
147
149template<>
150struct hash<mcrl2::lts::transition>
151{
152 std::size_t operator()(const mcrl2::lts::transition& t) const
153 {
154 return t.from() << 2 ^ t.label() << 1 ^ t.to();
155 }
156};
157
158} // namespace std
159
160
162
163#endif // MCRL2_LTS_TRANSITION_H
A class containing triples, source label and target representing transitions.
Definition transition.h:43
void set_label(const size_type label)
Set the label of the transition.
Definition transition.h:104
transition & operator=(const transition &t)=default
Assignment.
void set_to(const size_type to)
Set the target of the transition.
Definition transition.h:111
bool operator<(const transition &t) const
Standard lexicographic ordering on transitions.
Definition transition.h:135
transition(const std::size_t f, const std::size_t l, const std::size_t t)
Constructor (there is no default constructor).
Definition transition.h:58
size_type from() const
The source of the transition.
Definition transition.h:77
transition & operator=(transition &&t)=default
Move assignment.
bool operator!=(const transition &t) const
Standard inequality on transitions.
Definition transition.h:125
size_type label() const
The label of the transition.
Definition transition.h:83
size_type to() const
The target of the transition.
Definition transition.h:90
void set_from(const size_type from)
Set the source of the transition.
Definition transition.h:97
transition(transition &&t)=default
Move constructor.
transition(const transition &t)=default
Copy constructor.
std::size_t size_type
The type of the elements in a transition.
Definition transition.h:46
bool operator==(const transition &t) const
Standard equality on transitions.
Definition transition.h:118
transition_sort_style
Transition sort styles.
Definition transition.h:34
static const std::size_t const_tau_label_index
Definition transition.h:27
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
STL namespace.
std::size_t operator()(const mcrl2::lts::transition &t) const
Definition transition.h:152
#define hash(l, r, m)
Definition tree_set.cpp:23