mCRL2
Loading...
Searching...
No Matches
print.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
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/// \file mcrl2/lps/print.h
10/// \brief Pretty printer for linear process specifications.
11
12#ifndef MCRL2_LPS_PRINT_H
13#define MCRL2_LPS_PRINT_H
14
15#include "mcrl2/data/parse.h"
16#include "mcrl2/data/set_identifier_generator.h"
17#include "mcrl2/lps/specification.h"
18#include "mcrl2/lps/stochastic_specification.h"
19#include "mcrl2/lps/traverser.h"
20#include "mcrl2/process/print.h"
21
22namespace mcrl2::lps
23{
24
25namespace detail
26{
27
28template <typename Derived>
30{
32
33 using super::enter;
34 using super::leave;
35 using super::apply;
36 using super::derived;
41 using super::print_list;
43
46
48 : m_process_name("P")
49 {}
50
52 {
54 }
55
57 {
58 return m_process_name;
59 }
60
61 template <typename Container>
62 void print_numbered_list(const Container& container,
63 const std::string& separator = ", ",
64 const std::string& number_separator = "",
65 std::size_t index = 0,
66 bool print_start_separator = false,
67 bool print_empty_container = false
68 )
69 {
70 if (container.empty() && !print_empty_container)
71 {
72 return;
73 }
74 for (auto i = container.begin(); i != container.end(); ++i)
75 {
76 derived().print("\n");
77 derived().print(number_separator);
78 derived().print("%");
79 derived().print(utilities::number2string(index++));
80
81 derived().print("\n");
82 if (i == container.begin() && !print_start_separator)
83 {
84 derived().print(number_separator);
85 }
86 else
87 {
88 derived().print(separator);
89 }
90 derived().apply(*i);
91 }
92 }
93
94 void apply(const lps::deadlock& x)
95 {
96 derived().enter(x);
97 derived().print("delta");
98 if (x.has_time())
99 {
100 derived().print(" @ ");
101 print_expression(x.time(), precedence(x.time()) < core::detail::max_precedence);
102 }
103 derived().leave(x);
104 }
105
106 void apply(const lps::multi_action& x)
107 {
108 derived().enter(x);
109 if (x.actions().empty())
110 {
111 derived().print("tau");
112 }
113 else
114 {
115 print_list(x.actions(), "", "", "|");
116 }
117 if (x.has_time())
118 {
119 derived().print(" @ ");
120 print_expression(x.time(), precedence(x.time()) < core::detail::max_precedence);
121 }
122 derived().leave(x);
123 }
124
125 void apply(const lps::deadlock_summand& x)
126 {
127 derived().enter(x);
128 print_variables(x.summation_variables(), true, true, false, "sum ", ".\n ", ",");
129 print_condition(x.condition(), " ->\n ");
130 derived().apply(x.deadlock());
131 derived().leave(x);
132 }
133
135 {
136 derived().enter(x);
137 if (x.variables().empty()) // do not print the empty distribution
138 {
139 return;
140 }
141 derived().print("dist ");
142 print_variables(x.variables(), true, true, false, "", "");
143 derived().print("[");
144 derived().apply(x.distribution());
145 derived().print("]");
146 derived().leave(x);
147 }
148
150 { }
151
153 {
155 {
156 derived().apply(x.distribution());
157 derived().print(" .\n ");
158 }
159 }
160
161 template <typename ActionSummand>
162 void print_action_summand(const ActionSummand& x)
163 {
164 derived().enter(x);
165 print_variables(x.summation_variables(), true, true, false, "sum ", ".\n ", ",");
166 print_condition(x.condition(), " ->\n ");
167 derived().apply(x.multi_action());
168 derived().print(" .\n ");
169 print_distribution(x);
170 derived().print(m_process_name);
171 derived().print("(");
172 print_assignments(x.assignments(), true, "", "", ", ");
173 derived().print(")");
174 derived().leave(x);
175 }
176
177 void apply(const lps::action_summand& x)
178 {
179 print_action_summand(x);
180 }
181
183 {
184 print_action_summand(x);
185 }
186
188 {
189 derived().enter(x);
190 derived().print("init ");
191 derived().print(m_process_name);
192 print_variables(x.expressions(), false);
193 derived().print(";");
194 derived().leave(x);
195 }
196
198 {
199 derived().enter(x);
200 derived().print("init ");
202 {
203 derived().apply(x.distribution());
204 derived().print(" . ");
205 }
206 derived().print(m_process_name);
207 print_variables(x.expressions(), false);
208 derived().print(";");
209 derived().leave(x);
210 }
211
212 // this overload is enabled for linear_process and stochastic_linear_process
213 template <typename LinearProcess>
214 void print_linear_process(const LinearProcess& x)
215 {
216 // Generate a unique process name with P as prefix
218 generator.add_identifiers(find_identifiers(x));
219 m_process_name = generator(m_process_name);
220
221 derived().enter(x);
222 derived().print("proc ");
223 derived().print(m_process_name);
224
225 print_variables(x.process_parameters(), true, true, false, "(", ")", ", ");
226
228 {
229 derived().print(" =");
230
231 std::string separator = " + ";
232 std::string number_separator = " ";
233
234 // print action summands
235 print_numbered_list(x.action_summands(), separator, number_separator, 1, false);
236
237 // print deadlock summands
238 print_numbered_list(x.deadlock_summands(), separator, number_separator, x.action_summands().size() + 1, true);
239
240 // print delta if there are no summands
241 if (x.action_summands().empty() && (x.deadlock_summands().empty()))
242 {
243 deadlock_summand_vector v;
244 v.emplace_back(data::variable_list(),
245 data::sort_bool::true_(),
246 lps::deadlock(data::parse_data_expression("0")));
247 print_numbered_list(v, separator, number_separator, 1, true);
248 }
249 }
250 else
251 {
252 derived().print(" =\n ");
253
254 // print action summands
255 std::string opener = "";
256 std::string closer = "";
257 std::string separator = "\n + ";
258 print_list(x.action_summands(), opener, closer, separator);
259
260 // print deadlock summands
261 if (!x.action_summands().empty())
262 {
263 opener = separator;
264 }
265 print_list(x.deadlock_summands(), opener, closer, separator);
266
267 // print delta if there are no summands
268 if (x.action_summands().empty() && (x.deadlock_summands().empty()))
269 {
270 deadlock_summand_vector v;
271 v.emplace_back(data::variable_list(),
272 data::sort_bool::true_(),
273 lps::deadlock(data::parse_data_expression("0")));
274 print_list(v, opener, closer, separator);
275 }
276 }
277
278 derived().print(";\n");
279 derived().leave(x);
280 }
281
282 void apply(const linear_process& x)
283 {
284 print_linear_process(x);
285 }
286
288 {
289 print_linear_process(x);
290 }
291
292 template <typename Specification>
293 void print_specification(const Specification& x)
294 {
295 derived().enter(x);
296 derived().apply(x.data());
297 print_action_declarations(x.action_labels(), "act ",";\n\n", ";\n ");
298 print_variables(x.global_variables(), true, true, true, "glob ", ";\n\n", ";\n ");
299 derived().apply(x.process());
300 derived().print("\n");
301 derived().apply(x.initial_process());
302 derived().print("\n");
303 derived().leave(x);
304 }
305
306 void apply(const specification& x)
307 {
308 print_specification(x);
309 }
310
312 {
313 print_specification(x);
314 }
315};
316
317} // namespace detail
318
319/// \brief Prints the object x to a stream.
321{
322 template <typename T>
323 void operator()(const T& x, std::ostream& out, bool precedence_aware)
324 {
325 core::detail::apply_printer<lps::detail::printer> printer(out, precedence_aware);
326 printer.apply(x);
327 }
328};
329
330/// \brief Returns a string representation of the object x.
331template <typename T>
332std::string pp(const T& x, bool precedence_aware = true)
333{
334 std::ostringstream out;
335 stream_printer()(x, out, precedence_aware);
336 return out.str();
337}
338
339} // namespace mcrl2::lps
340
341#endif // MCRL2_LPS_PRINT_H
A unordered_map class in which aterms can be stored.
parse_node_unexpected_exception(const parser &p, const parse_node &node)
Definition parse.h:76
\brief Assignment of a data expression to a variable
Definition assignment.h:88
const data_expression & rhs() const
Definition assignment.h:119
const variable & lhs() const
Definition assignment.h:114
data_expression & operator=(const data_expression &) noexcept=default
data_expression & operator=(data_expression &&) noexcept=default
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:107
data_expression(const data_expression &) noexcept=default
Move semantics.
void translate_user_notation()
Translate user notation within the equations of the data specification.
data_specification()=default
Default constructor. Generate a data specification that contains only booleans and positive numbers.
Rewriter that operates on data expressions.
Definition rewriter.h:84
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief A sort expression
\brief A data variable
Definition variable.h:25
const sort_expression & sort() const
Definition variable.h:40
const data::data_expression & condition() const
Returns the condition of the rule.
const process::process_expression & rhs() const
Returns the right hand side of the rule.
data::data_expression & condition()
Returns the condition of the rule.
action_rename_rule()=default
Constructor.
action_rename_rule(const data::variable_list &variables, const data::data_expression &condition, const process::action &lhs, const process::process_expression &rhs)
Constructor.
process::process_expression m_rhs
right hand side of the rule. Can only be an action, tau or delta.
data::variable_list m_variables
The data variables of the rule.
bool check_that_rhs_is_tau_delta_or_an_action() const
data::variable_list & variables()
Returns the variables of the rule.
process::action m_lhs
The left hand side of the rule.
action_rename_rule(const atermpp::aterm &t)
Constructor.
data::data_expression m_condition
The condition of the rule.
const data::variable_list & variables() const
Returns the variables of the rule.
const process::action & lhs() const
Returns the left hand side of the rule.
Action rename specification.
const std::vector< action_rename_rule > & rules() const
Returns the action rename rules.
data::data_specification m_data
The data specification of the action rename specification.
process::action_label_list & action_labels()
Returns the sequence of action labels.
std::vector< action_rename_rule > m_rules
The action rename rules of the action rename specification.
action_rename_specification(const data::data_specification &data, const process::action_label_list &action_labels, const std::vector< action_rename_rule > &rules)
Constructor.
std::vector< action_rename_rule > & rules()
Returns the action rename rules.
action_rename_specification()=default
Constructor.
process::action_label_list m_action_labels
The action labels of the action rename specification.
const process::action_label_list & action_labels() const
Returns the sequence of action labels.
action_rename_specification(atermpp::aterm t)
Constructor.
bool is_well_typed() const
Indicates whether the action_rename_specification is well typed.
action_rename_specification operator()(const action_rename_specification &arspec, const stochastic_specification &lpsspec)
Type check an action_rename_specification.
Definition typecheck.h:97
process::detail::action_context m_action_context
Definition typecheck.h:72
action_rename_rule typecheck_action_rename_rule(const action_rename_rule &x, const process::action_label_list &action_labels)
Definition typecheck.h:74
data::data_type_checker m_data_type_checker
Definition typecheck.h:71
action_rename_type_checker()
Default constructor for an action rename type checker.
Definition typecheck.h:88
LPS summand containing a multi-action.
data::data_expression_list next_state(const data::variable_list &process_parameters) const
Returns the next state corresponding to this summand.
Definition lps.cpp:71
LPS summand containing a deadlock.
Represents a deadlock.
Definition deadlock.h:23
deadlock(data::data_expression time=data::undefined_real())
Constructor.
Definition deadlock.h:33
bool has_time() const
Returns true if time is available.
Definition deadlock.h:39
const data::data_expression & time() const
Returns the time.
Definition deadlock.h:46
data::data_expression & time()
Returns the time.
Definition deadlock.h:53
multi_action_type_checker(const data::data_specification &dataspec=data::data_specification())
Default constructor.
Definition typecheck.h:41
multi_action operator()(const process::untyped_multi_action &x)
Type check a multi action. Throws a mcrl2::runtime_error exception if the expression is not well type...
Definition typecheck.h:50
data::detail::variable_context m_variable_context
Definition typecheck.h:26
process::detail::action_context m_action_context
Definition typecheck.h:25
data::data_type_checker m_data_type_checker
Definition typecheck.h:24
multi_action_type_checker(const data::data_specification &dataspec, const VariableContainer &variables, const ActionLabelContainer &action_labels)
Definition typecheck.h:30
\brief A timed multi-action
bool has_time() const
Returns true if time is available.
const process::action_list & actions() const
multi_action(const process::action &l)
Constructor.
multi_action operator+(const multi_action &other) const
Joins the actions of both multi actions.
multi_action & operator=(multi_action &&) noexcept=default
const data::data_expression & time() const
multi_action(const process::action_list &actions=process::action_list(), data::data_expression time=data::undefined_real())
Constructor. Actions are sorted to establish the sorted-storage invariant.
process_initializer & operator=(process_initializer &&) noexcept=default
process_initializer(const data::data_expression_list &expressions)
Constructor.
Linear process specification.
LPS summand containing a multi-action.
const stochastic_distribution & distribution() const
Returns the distribution of this summand.
\brief A stochastic distribution
stochastic_distribution & operator=(stochastic_distribution &&) noexcept=default
stochastic_distribution()
\brief Default constructor X3.
const data::variable_list & variables() const
bool is_defined() const
Returns true if the distribution is defined, i.e. it contains a valid distribution....
stochastic_distribution(const data::variable_list &variables, const data::data_expression &distribution)
\brief Constructor Z12.
const data::data_expression & distribution() const
stochastic_process_initializer(const data::data_expression_list &expressions, const stochastic_distribution &distribution)
Constructor.
const stochastic_distribution & distribution() const
\brief An action label
\brief A multiset of action names
action(const action_label &label, const data::data_expression_list &arguments)
\brief Constructor Z14.
const data::data_expression_list & arguments() const
action(const action &) noexcept=default
Move semantics.
const action_label & label() const
\brief The allow operator
\brief The at operator
at(const process_expression &operand, const data::data_expression &time_stamp)
\brief Constructor Z14.
const data::data_expression & time_stamp() const
const process_expression & operand() const
\brief The block operator
\brief The bounded initialization
bounded_init(const process_expression &left, const process_expression &right)
\brief Constructor Z14.
\brief The choice operator
const process_expression & left() const
choice(const process_expression &left, const process_expression &right)
\brief Constructor Z14.
const process_expression & right() const
\brief The communication operator
communication_expression(const action_name_multiset &action_name, const core::identifier_string &name)
\brief Constructor Z12.
\brief The value delta
delta()
\brief Default constructor X3.
\brief The hide operator
\brief The if-then-else operator
if_then_else(const data::data_expression &condition, const process_expression &then_case, const process_expression &else_case)
\brief Constructor Z14.
\brief The if-then operator
const process_expression & then_case() const
if_then(const data::data_expression &condition, const process_expression &then_case)
\brief Constructor Z14.
const data::data_expression & condition() const
\brief The left merge operator
left_merge(const process_expression &left, const process_expression &right)
\brief Constructor Z14.
\brief The merge operator
merge(const process_expression &left, const process_expression &right)
\brief Constructor Z14.
\brief A process equation
process_equation()
\brief Default constructor X3.
process_equation(const process_equation &) noexcept=default
Move semantics.
const data::variable_list & formal_parameters() const
const process_identifier & identifier() const
const process_expression & expression() const
\brief A process expression
process_expression & operator=(const process_expression &) noexcept=default
process_expression(const process_expression &) noexcept=default
Move semantics.
process_expression & operator=(process_expression &&) noexcept=default
\brief A process identifier
const process_identifier & identifier() const
const data::data_expression_list & actual_parameters() const
const process_identifier & identifier() const
Process specification consisting of a data specification, action labels, a sequence of process equati...
process_expression & init()
Returns the initialization of the process specification.
const process_expression & init() const
Returns the initialization of the process specification.
const process::action_label_list & action_labels() const
Returns the action label specification.
\brief A rename expression
\brief The rename operator
\brief The sequential composition
const process_expression & right() const
const process_expression & left() const
seq(const process_expression &left, const process_expression &right)
\brief Constructor Z14.
\brief The distribution operator
const data::variable_list & variables() const
const data::data_expression & distribution() const
\brief The sum operator
const process_expression & operand() const
\brief The synchronization operator
const process_expression & left() const
sync(const process_expression &left, const process_expression &right)
\brief Constructor Z14.
const process_expression & right() const
\brief The value tau
tau()
\brief Default constructor X3.
\brief An untyped multi action or data application
untyped_multi_action()
\brief Default constructor X3.
Standard exception class for reporting runtime errors.
Definition exception.h:27
D_ParserTables parser_tables_mcrl2
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:435
static data_specification const & default_specification()
Definition parse.h:28
bool check_assignment_variables(assignment_list const &assignments, variable_list const &variables)
Returns true if the left hand sides of assignments are contained in variables.
Namespace for system defined sort bool_.
Definition bool.h:29
bool is_bool(const sort_expression &e)
Recogniser for sort expression Bool.
Definition bool.h:51
bool is_and_application(const atermpp::aterm &e)
Recogniser for application of &&.
Definition bool.h:278
bool is_not_application(const atermpp::aterm &e)
Recogniser for application of !.
Definition bool.h:214
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:74
Namespace for system defined sort real_.
bool is_real(const sort_expression &e)
Recogniser for sort expression Real.
Definition real1.h:55
int precedence(const data_expression &x)
Definition print.h:402
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
bool is_well_typed(const T &x)
Checks well typedness of an LPS object.
bool check_action_labels(const process::action_list &actions, const std::set< process::action_label > &labels)
Returns true if the labels of the given actions are contained in labels.
multi_action complete_multi_action(process::untyped_multi_action &x, const process::action_label_list &action_decls, const data::data_specification &data_spec=data::detail::default_specification())
Definition lps.cpp:148
process::action_label rename_action_label(const process::action_label &act, const std::regex &matching_regex, const std::string &replacing_fmt)
bool check_action_label_sorts(const process::action_label_list &action_labels, const std::set< data::sort_expression > &sorts)
Returns true if the sorts of the given action labels are contained in sorts.
bool check_well_typedness(const T &x)
Checks well typedness of an LPS object, and will print error messages to stderr.
bool check_action_sorts(const process::action_list &actions, const std::set< data::sort_expression > &sorts)
Returns true if the sorts of the given actions are contained in sorts.
void complete_action_rename_specification(action_rename_specification &x, const lps::stochastic_specification &spec)
Definition lps.cpp:166
process::untyped_multi_action parse_multi_action_new(const std::string &text)
Definition lps.cpp:130
multi_action complete_multi_action(process::untyped_multi_action &x, multi_action_type_checker &typechecker, const data::data_specification &data_spec=data::detail::default_specification())
Definition lps.cpp:140
action_rename_specification parse_action_rename_specification_new(const std::string &text)
Definition lps.cpp:156
The main namespace for the LPS library.
Definition constelm.h:18
std::string pp(const lps::stochastic_specification &x, bool arg0)
Definition lps.cpp:40
std::set< data::variable > find_all_variables(const lps::linear_process &x)
Definition lps.cpp:47
std::string pp(const lps::specification &x, bool arg0)
Definition lps.cpp:35
std::set< data::sort_expression > find_sort_expressions(const lps::stochastic_specification &x)
Definition lps.cpp:46
std::string pp_extended(const lps::stochastic_specification &x, const std::string &process_name, bool precedence_aware=true)
Definition lps.cpp:79
std::set< process::action_label > find_action_labels(const lps::stochastic_specification &x)
Definition lps.cpp:68
std::set< data::variable > find_free_variables(const lps::stochastic_specification &x)
Definition lps.cpp:56
std::string pp(const lps::stochastic_distribution &x, bool arg0)
Definition lps.cpp:37
std::string pp_extended(const stochastic_specification &x, const std::string &process_name, bool precedence_aware, bool summand_numbers)
Definition lps.cpp:98
std::set< data::variable > find_all_variables(const lps::multi_action &x)
Returns all variables inside a multi-action.
Definition lps.cpp:52
std::set< data::variable > find_all_variables(const lps::stochastic_specification &x)
Definition lps.cpp:50
bool check_well_typedness(const specification &x)
Definition lps.cpp:118
std::set< data::variable > find_free_variables(const lps::linear_process &x)
Definition lps.cpp:53
bool check_well_typedness(const linear_process &x)
Definition lps.cpp:108
std::set< data::function_symbol > find_function_symbols(const lps::stochastic_specification &x)
Definition lps.cpp:62
std::string pp_extended(const specification &x, const std::string &process_name, bool precedence_aware, bool summand_numbers)
Definition lps.cpp:88
lps::stochastic_specification action_rename(const action_rename_specification &action_rename_spec, const lps::stochastic_specification &lps_old_spec, const data::rewriter &rewr, const bool enable_rewriting)
Rename the actions in a linear specification using a given action_rename_spec.
std::set< process::action_label > find_action_labels(const lps::process_initializer &x)
Definition lps.cpp:66
std::set< data::variable > find_free_variables(const lps::specification &x)
Definition lps.cpp:55
multi_action typecheck_multi_action(process::untyped_multi_action &mult_act, const data::data_specification &data_spec, const process::action_label_list &action_decls)
Type check a multi action Throws an exception if something went wrong.
Definition typecheck.h:125
void normalize_sorts(lps::specification &x, const data::sort_specification &)
Definition lps.cpp:42
std::set< data::variable > find_free_variables(const lps::deadlock &x)
Definition lps.cpp:57
std::string pp(const lps::deadlock_summand &x, bool arg0)
Definition lps.cpp:31
std::set< process::action_label > find_action_labels(const lps::linear_process &x)
Definition lps.cpp:65
lps::multi_action normalize_sorts(const lps::multi_action &x, const data::sort_specification &sortspec)
Definition lps.cpp:41
std::set< data::variable > find_free_variables(const lps::stochastic_linear_process &x)
Definition lps.cpp:54
multi_action typecheck_multi_action(process::untyped_multi_action &mult_act, multi_action_type_checker &typechecker)
Type check a multi action Throws an exception if something went wrong.
Definition typecheck.h:141
std::set< data::function_symbol > find_function_symbols(const lps::specification &x)
Definition lps.cpp:61
std::string pp(const lps::stochastic_linear_process &x, bool arg0)
Definition lps.cpp:38
std::set< data::variable > find_free_variables(const lps::stochastic_process_initializer &x)
Definition lps.cpp:60
std::string pp(const T &x, bool precedence_aware=true)
Returns a string representation of the object x.
Definition print.h:332
std::set< data::variable > find_free_variables(const lps::multi_action &x)
Definition lps.cpp:58
std::string pp(const lps::deadlock &x, bool arg0)
Definition lps.cpp:30
void normalize_sorts(lps::stochastic_specification &x, const data::sort_specification &)
Definition lps.cpp:43
std::set< data::variable > find_free_variables(const lps::process_initializer &x)
Definition lps.cpp:59
std::string pp(const lps::stochastic_action_summand &x, bool arg0)
Definition lps.cpp:36
std::string pp(const lps::stochastic_process_initializer &x, bool arg0)
Definition lps.cpp:39
std::string pp(const lps::linear_process &x, bool arg0)
Definition lps.cpp:32
std::string pp(const lps::multi_action &x, bool arg0)
Definition lps.cpp:33
atermpp::aterm action_rename_specification_to_aterm(const action_rename_specification &spec)
atermpp::aterm action_rename_rule_to_aterm(const action_rename_rule &rule)
std::set< data::sort_expression > find_sort_expressions(const lps::specification &x)
Definition lps.cpp:45
std::string pp(const lps::action_summand &x, bool arg0)
Definition lps.cpp:29
std::set< data::variable > find_all_variables(const lps::specification &x)
Definition lps.cpp:49
stochastic_specification action_rename(const std::regex &matching_regex, const std::string &replacing_fmt, const stochastic_specification &lps_old_spec)
Rename actions in given specification based on a regular expression and a string that specifies how t...
bool check_well_typedness(const stochastic_specification &x)
Definition lps.cpp:123
std::set< data::variable > find_all_variables(const lps::deadlock &x)
Definition lps.cpp:51
action_rename_specification typecheck_action_rename_specification(const action_rename_specification &arspec, const lps::stochastic_specification &lpsspec)
Type checks an action rename specification.
Definition typecheck.h:154
std::set< data::variable > find_all_variables(const lps::stochastic_linear_process &x)
Definition lps.cpp:48
bool check_well_typedness(const stochastic_linear_process &x)
Definition lps.cpp:113
lps::multi_action translate_user_notation(const lps::multi_action &x)
Definition lps.cpp:44
std::set< core::identifier_string > find_identifiers(const lps::stochastic_specification &x)
Definition lps.cpp:64
std::set< core::identifier_string > find_identifiers(const lps::specification &x)
Definition lps.cpp:63
std::set< process::action_label > find_action_labels(const lps::specification &x)
Definition lps.cpp:67
std::string pp(const lps::process_initializer &x, bool arg0)
Definition lps.cpp:34
bool check_process_instance_assignment(const process_equation &eq, const process_instance_assignment &inst)
Returns true if the process instance assignment a matches with the process equation eq.
Definition is_linear.h:25
bool is_process(const process_expression &x)
Returns true if the argument is a process instance.
Definition is_linear.h:68
bool is_conditional_deadlock(const process_expression &x)
Returns true if the argument is a conditional deadlock.
Definition is_linear.h:128
bool is_linear_process_term(const process_expression &x)
Returns true if the argument is a linear process.
Definition is_linear.h:154
bool check_process_instance(const process_equation &eq, const process_instance &init)
Returns true if the process instance a matches with the process equation eq.
Definition is_linear.h:46
bool is_alternative(const process_expression &x)
Returns true if the argument is an alternative composition.
Definition is_linear.h:144
bool is_timed_deadlock(const process_expression &x)
Returns true if the argument is a deadlock.
Definition is_linear.h:93
bool is_action_prefix(const process_expression &x)
Returns true if the argument is an action prefix.
Definition is_linear.h:120
bool is_stochastic_process(const process_expression &x)
Returns true if the argument is a process instance, optionally wrapped in a stochastic distribution.
Definition is_linear.h:78
bool is_multiaction(const process_expression &x)
Returns true if the argument is a multi-action.
Definition is_linear.h:102
bool is_conditional_action_prefix(const process_expression &x)
Returns true if the argument is a conditional action prefix.
Definition is_linear.h:136
bool is_timed_multiaction(const process_expression &x)
Returns true if the argument is a multi-action.
Definition is_linear.h:112
The main namespace for the Process library.
bool is_at(const atermpp::aterm &x)
bool is_linear(const process_specification &p, bool verbose=false)
Returns true if the process specification is linear.
Definition is_linear.h:344
bool is_linear(const process_expression &x, const process_equation &eqn)
Returns true if the process expression is linear.
Definition is_linear.h:389
bool is_process_instance(const atermpp::aterm &x)
bool is_process_instance_assignment(const atermpp::aterm &x)
bool is_tau(const atermpp::aterm &x)
bool is_seq(const atermpp::aterm &x)
bool is_delta(const atermpp::aterm &x)
bool is_linear(const process_equation &eqn)
Returns true if the process equation is linear.
Definition is_linear.h:379
bool is_sum(const atermpp::aterm &x)
bool is_action(const atermpp::aterm &x)
bool is_if_then(const atermpp::aterm &x)
bool is_choice(const atermpp::aterm &x)
bool is_stochastic_operator(const atermpp::aterm &x)
bool is_sync(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const mcrl2::lps::action_rename_specification &s)
Output a action_rename_rule to ostream.
std::ostream & operator<<(std::ostream &out, const mcrl2::lps::action_rename_rule &r)
Output an action_rename_rule to ostream.
core::identifier_string parse_Id(const parse_node &node) const
Definition parse.h:231
const parser & m_parser
Definition parse.h:83
data::data_expression parse_DataExprUnit(const core::parse_node &node) const
Definition parse_impl.h:255
data::data_expression parse_DataExpr(const core::parse_node &node) const
Definition parse_impl.h:208
data_specification_actions(const core::parser &parser_)
Definition parse_impl.h:297
bool callback_DataSpecElement(const core::parse_node &node, untyped_data_specification &result) const
Definition parse_impl.h:410
std::vector< lps::action_rename_rule > parse_ActionRenameRuleList(const core::parse_node &node) const
Definition parse_impl.h:71
process::action parse_Action_as_action(const core::parse_node &node) const
Definition parse_impl.h:47
bool callback_ActionRenameSpec(const core::parse_node &node, data::untyped_data_specification &dataspec_result, lps::action_rename_specification &result) const
Definition parse_impl.h:87
std::vector< lps::action_rename_rule > parse_ActionRenameRuleSpec(const core::parse_node &node) const
Definition parse_impl.h:76
lps::action_rename_specification parse_ActionRenameSpec(const core::parse_node &node) const
Definition parse_impl.h:119
process::process_expression parse_ActionRenameRuleRHS(const core::parse_node &node) const
Definition parse_impl.h:53
action_rename_actions(const core::parser &parser_)
Definition parse_impl.h:42
lps::action_rename_rule parse_ActionRenameRule(const core::parse_node &node) const
Definition parse_impl.h:61
Function object for applying a substitution to LPS data types.
bool is_well_typed(const linear_process_base< ActionSummand > &p) const
Checks well typedness of a linear process.
bool is_well_typed(const process::action &a) const
Traverses an action.
bool is_well_typed(const action_summand &s) const
Checks well typedness of a summand.
bool check_time(const data::data_expression &t, const std::string &type) const
Checks if the sort of t has type real.
bool is_well_typed(const data::assignment &a) const
Traverses an assignment.
bool check_condition(const data::data_expression &t, const std::string &type) const
Checks if the sort of t has type bool.
bool is_well_typed(const stochastic_specification &spec) const
bool is_well_typed(const data::variable &d) const
Checks well typedness of a variable.
bool check_assignments(const data::assignment_list &l, const std::string &type) const
Checks if the assignments are well typed and have unique left hand sides.
bool is_well_typed(const specification &spec) const
bool is_well_typed(const data::sort_expression &d) const
Checks well typedness of a sort expression.
bool is_well_typed_container(const Container &c) const
Checks well typedness of the elements of a container.
bool is_well_typed(const process::action_label &d) const
Traverses an action label.
bool is_well_typed(const specification_base< LinearProcess, InitialProcessExpression > &spec, const std::set< data::variable > &free_variables) const
Checks well typedness of a linear process specification.
bool is_well_typed(const deadlock &d) const
Checks well typedness of a deadlock.
bool is_well_typed(const data::data_expression &d) const
Checks well typedness of a data expression.
bool is_well_typed(const deadlock_summand &s) const
Checks well typedness of a summand.
bool is_well_typed(const multi_action &a) const
Checks well typedness of a multi-action.
process::untyped_multi_action parse_MultAct(const core::parse_node &node) const
Definition parse_impl.h:29
multi_action_actions(const core::parser &parser_)
Definition parse_impl.h:25
bool & print_summand_numbers()
Definition print.h:51
void print_distribution(const lps::stochastic_action_summand &x)
Definition print.h:152
void print_numbered_list(const Container &container, const std::string &separator=", ", const std::string &number_separator="", std::size_t index=0, bool print_start_separator=false, bool print_empty_container=false)
Definition print.h:62
void apply(const lps::stochastic_action_summand &x)
Definition print.h:182
void print_linear_process(const LinearProcess &x)
Definition print.h:214
void apply(const lps::deadlock &x)
Definition print.h:94
void apply(const stochastic_linear_process &x)
Definition print.h:287
void apply(const lps::action_summand &x)
Definition print.h:177
void apply(const lps::stochastic_process_initializer &x)
Definition print.h:197
std::string & process_name()
Definition print.h:56
void apply(const lps::stochastic_distribution &x)
Definition print.h:134
void apply(const lps::process_initializer &x)
Definition print.h:187
void print_specification(const Specification &x)
Definition print.h:293
void print_distribution(const lps::action_summand &)
Definition print.h:149
void apply(const stochastic_specification &x)
Definition print.h:311
void apply(const specification &x)
Definition print.h:306
std::string m_process_name
Definition print.h:45
void apply(const lps::deadlock_summand &x)
Definition print.h:125
void print_action_summand(const ActionSummand &x)
Definition print.h:162
void apply(const linear_process &x)
Definition print.h:282
void apply(const lps::multi_action &x)
Definition print.h:106
Prints the object x to a stream.
Definition print.h:321
void operator()(const T &x, std::ostream &out, bool precedence_aware)
Definition print.h:323
action_actions(const core::parser &parser_)
Definition parse_impl.h:46
action_label_list parse_ActSpec(const core::parse_node &node) const
Definition parse_impl.h:86
data::untyped_data_parameter parse_Action(const core::parse_node &node) const
Definition parse_impl.h:50
bool callback_ActDecl(const core::parse_node &node, action_label_vector &result) const
Definition parse_impl.h:60
data::untyped_data_parameter_list parse_ActionList(const core::parse_node &node) const
Definition parse_impl.h:55
action_label_list parse_ActDeclList(const core::parse_node &node) const
Definition parse_impl.h:79
Converts a process expression into linear process format. Use the convert member functions for this.
lps::deadlock_summand_vector m_deadlock_summands
The result of the conversion.
process_equation m_equation
The process equation that is checked.
lps::specification convert(const process_specification &p)
Converts a process_specification into a specification. Throws non_linear_process if a non-linear sub-...
void leave(const process::left_merge &x)
Visit left_merge node.
lps::action_summand_vector m_action_summands
The result of the conversion.
void leave(const process::bounded_init &x)
Visit bounded_init node.
void convert(const process_equation &)
Converts a process equation.
void leave(const process::if_then_else &x)
Visit if_then_else node.
Exception that is thrown by linear_process_expression_traverser.
Definition is_linear.h:175
Checks if a process equation is linear. Use the is_linear() member function for this.
Definition is_linear.h:164
linear_process_expression_traverser(const process_equation &eqn_=process_equation())
Definition is_linear.h:181
void enter(const process::process_instance &x)
Definition is_linear.h:186
process_equation eqn
The process equation that is checked.
Definition is_linear.h:171
bool is_linear(const process_expression &x, bool verbose=false)
Returns true if the process equation e is linear.
Definition is_linear.h:322
void enter(const process::process_instance_assignment &x)
Definition is_linear.h:194
process::action_name_multiset parse_MultActId(const core::parse_node &node) const
Definition parse_impl.h:103
bool callback_mCRL2Spec(const core::parse_node &node, untyped_process_specification &result) const
Definition parse_impl.h:219
bool is_process_expression(const std::string &s) const
Definition parse_impl.h:153
process::process_equation parse_ProcDecl(const core::parse_node &node) const
Definition parse_impl.h:196
bool is_proc_expr_stochastic_operator(const core::parse_node &node) const
Definition parse_impl.h:158
process::rename_expression_list parse_RenExprSet(const core::parse_node &node) const
Definition parse_impl.h:148
untyped_process_specification parse_mCRL2Spec(const core::parse_node &node) const
Definition parse_impl.h:260
process::action_name_multiset_list parse_MultActIdList(const core::parse_node &node) const
Definition parse_impl.h:108
process::action_name_multiset_list parse_MultActIdSet(const core::parse_node &node) const
Definition parse_impl.h:113
data::untyped_data_parameter parse_Action(const core::parse_node &node) const
Definition parse_impl.h:165
process::communication_expression_list parse_CommExprList(const core::parse_node &node) const
Definition parse_impl.h:128
process::communication_expression_list parse_CommExprSet(const core::parse_node &node) const
Definition parse_impl.h:133
process::rename_expression parse_RenExpr(const core::parse_node &node) const
Definition parse_impl.h:138
process::communication_expression parse_CommExpr(const core::parse_node &node) const
Definition parse_impl.h:118
std::vector< process::process_equation > parse_ProcSpec(const core::parse_node &node) const
Definition parse_impl.h:209
std::vector< process::process_equation > parse_ProcDeclList(const core::parse_node &node) const
Definition parse_impl.h:204
process::process_expression parse_ProcExpr(const core::parse_node &node) const
Definition parse_impl.h:170
process_actions(const core::parser &parser_)
Definition parse_impl.h:94
process::process_expression parse_Init(const core::parse_node &node) const
Definition parse_impl.h:214
core::identifier_string_list parse_ActIdSet(const core::parse_node &node) const
Definition parse_impl.h:98
process::rename_expression_list parse_RenExprList(const core::parse_node &node) const
Definition parse_impl.h:143
Converts a process expression into linear process format. Use the convert member functions for this.
void leave(const process::stochastic_operator &x)
Visit stochastic operator node.
lps::stochastic_action_summand_vector m_action_summands
The result of the conversion.
lps::deadlock_summand_vector m_deadlock_summands
The result of the conversion.
lps::stochastic_specification convert(const process_specification &p)
Converts a process_specification into a stochastic_specification. Throws non_linear_process if a non-...
std::vector< process::process_equation > equations
Definition parse_impl.h:26
process_specification construct_process_specification()
Definition parse_impl.h:29