mCRL2
Loading...
Searching...
No Matches
is_linear.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/process/is_linear.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_PROCESS_IS_LINEAR_H
13#define MCRL2_PROCESS_IS_LINEAR_H
14
15#include "mcrl2/process/traverser.h"
16
17namespace mcrl2
18{
19
20namespace process
21{
22
23namespace detail
24{
25
26/// \brief Returns true if the process instance assignment a matches with the process equation eq.
27inline
29{
31 {
32 return false;
33 }
35
36 // check if the left hand sides of the assignments exist
37 for (const auto& a: inst.assignments())
38 {
39 if (std::find(v.begin(), v.end(), a.lhs()) == v.end())
40 {
41 return false;
42 }
43 }
44 return true;
45}
46
47/// \brief Returns true if the process instance a matches with the process equation eq.
48inline
50{
52 {
53 return false;
54 }
57 data::variable_list::const_iterator i = v.begin();
58 data::data_expression_list::const_iterator j = e.begin();
59 for (; i != v.end(); ++i, ++j)
60 {
61 if (i->sort() != j->sort())
62 {
63 return false;
64 }
65 }
66 return true;
67}
68
69/// \brief Returns true if the argument is a process instance
70inline
72{
75 ;
76}
77
78/// \brief Returns true if the argument is a process instance, optionally wrapped in a stochastic
79/// distribution.
80inline
82{
83 if (is_process(x))
84 {
85 return true;
86 }
88 {
89 return is_process(atermpp::down_cast<stochastic_operator>(x).operand());
90 }
91 return false;
92}
93
94/// \brief Returns true if the argument is a deadlock
95inline
97{
98 return is_delta(x)
99 || is_at(x)
100 ;
101}
102
103/// \brief Returns true if the argument is a multi-action
104inline
106{
107 return is_tau(x)
108 || is_sync(x)
109 || is_action(x)
110 ;
111}
112
113/// \brief Returns true if the argument is a multi-action
114inline
116{
117 return is_at(x)
119}
120
121/// \brief Returns true if the argument is an action prefix
122inline
124{
125 return is_seq(x)
127}
128
129/// \brief Returns true if the argument is a conditional deadlock
130inline
132{
133 return is_if_then(x)
135}
136
137/// \brief Returns true if the argument is a conditional action prefix.
138inline
140{
141 return is_if_then(x)
143}
144
145/// \brief Returns true if the argument is an alternative composition
146inline
148{
149 return is_sum(x)
152 ;
153}
154
155/// \brief Returns true if the argument is a linear process
156inline
158{
159 return is_choice(x)
161 ;
162}
163
164/// \brief Checks if a process equation is linear.
165/// Use the is_linear() member function for this.
167{
169 using super::enter;
170 using super::leave;
171 using super::apply;
172
173 /// \brief The process equation that is checked.
175
176 /// \brief Exception that is thrown by linear_process_expression_traverser.
178 {
179 explicit non_linear_process_error(const std::string& msg)
180 : mcrl2::runtime_error(msg)
181 {}
182 };
183
185 : eqn(eqn_)
186 {}
187
188 // TODO: check if this function is needed
190 {
192 {
193 throw non_linear_process_error(process::pp(x) + " is not a valid process instance");
194 }
195 }
196
198 {
200 {
201 throw non_linear_process_error(process::pp(x) + " is not a valid process instance assignment");
202 }
203 }
204
205 void enter(const process::sum& x)
206 {
208 {
209 throw non_linear_process_error(process::pp(x.operand()) + " is not an alternative expression");
210 }
211 }
212
213 void enter(const process::block& x)
214 {
215 throw non_linear_process_error("block expression " + process::pp(x) + " encountered");
216 }
217
218 void enter(const process::hide& x)
219 {
220 throw non_linear_process_error("hide expression " + process::pp(x) + " encountered");
221 }
222
223 void enter(const process::rename& x)
224 {
225 throw non_linear_process_error("rename expression " + process::pp(x) + " encountered");
226 }
227
228 void enter(const process::comm& x)
229 {
230 throw non_linear_process_error("comm expression " + process::pp(x) + " encountered");
231 }
232
233 void enter(const process::allow& x)
234 {
235 throw non_linear_process_error("allow expression " + process::pp(x) + " encountered");
236 }
237
238 void enter(const process::sync& x)
239 {
241 {
243 {
244 throw non_linear_process_error(process::pp(x.left()) + " is not a multi action");
245 }
246 else
247 {
248 throw non_linear_process_error(process::pp(x.right()) + " is not a multi action");
249 }
250 }
251 }
252
253 void enter(const process::at& x)
254 {
256 {
257 throw non_linear_process_error(process::pp(x.operand()) + " is not a multi action and not a deadlock");
258 }
259 }
260
261 void enter(const process::seq& x)
262 {
264 {
265 throw non_linear_process_error(process::pp(x.left()) + " is not a timed multi action and not a process");
266 }
269 {
270 right = atermpp::down_cast<stochastic_operator>(right).operand();
271 }
272 if (is_process_instance(right))
273 {
274 const auto& right_ = atermpp::down_cast<process_instance>(right);
275 if (right_.identifier() != eqn.identifier())
276 {
277 throw non_linear_process_error(process::pp(right_) + " has an unexpected identifier");
278 }
279 }
281 {
282 const auto& right_ = atermpp::down_cast<process_instance_assignment>(right);
283 if (right_.identifier() != eqn.identifier())
284 {
285 throw non_linear_process_error(process::pp(right_) + " has an unexpected identifier");
286 }
287 }
288 else
289 {
290 std::cerr << "seq right hand side: " << process::pp(right) << std::endl;
291 throw std::runtime_error("unexpected error in visit_seq");
292 }
293 }
294
295 void enter(const process::if_then& x)
296 {
298 {
299 throw non_linear_process_error(process::pp(x) + " is not an action prefix and not a timed deadlock");
300 }
301 }
302
303 void enter(const process::if_then_else& x)
304 {
305 throw non_linear_process_error("if then else expression " + process::pp(x) + " encountered");
306 }
307
308 void enter(const process::bounded_init& x)
309 {
310 throw non_linear_process_error("bounded init expression " + process::pp(x) + " encountered");
311 }
312
313 void enter(const process::merge& x)
314 {
315 throw non_linear_process_error("merge expression " + process::pp(x) + " encountered");
316 }
317
318 void enter(const process::left_merge& x)
319 {
320 throw non_linear_process_error("left merge expression " + process::pp(x) + " encountered");
321 }
322
323
324 /// \brief Returns true if the process equation e is linear.
325 bool is_linear(const process_expression& x, bool verbose = false)
326 {
327 try
328 {
329 this->apply(x);
330 }
331 catch (non_linear_process_error& p)
332 {
333 if (verbose)
334 {
335 std::clog << p.what() << std::endl;
336 }
337 return false;
338 }
339 return true;
340 }
341};
342
343} // namespace detail
344
345/// \brief Returns true if the process specification is linear.
346inline
347bool is_linear(const process_specification& p, bool verbose = false)
348{
349 if (p.equations().size() != 1)
350 {
351 if (verbose)
352 {
353 std::clog << "warning: the number of equations is not equal to 1" << std::endl;
354 }
355 return false;
356 }
357 const process_equation& eqn = p.equations().front();
359 {
360 if (!visitor.is_linear(eqn.expression(), verbose))
361 {
362 if (verbose)
363 {
364 std::clog << "warning: the first equation is not linear" << std::endl;
365 }
366 return false;
367 }
369 {
370 if (verbose)
371 {
372 std::clog << "warning: the initial process " << process::pp(p.init()) << " is not a process instance or a process instance assignment" << std::endl;
373 }
374 return false;
375 }
376 }
377 return true;
378}
379
380/// \brief Returns true if the process equation is linear.
381inline
383{
385 return f.is_linear(eqn.expression());
386}
387
388/// \brief Returns true if the process expression is linear.
389/// \param x A process expression.
390/// \param eqn The linear equation belonging to the indicated process.
391inline
393{
395 return f.is_linear(x);
396}
397
398} // namespace process
399
400} // namespace mcrl2
401
402#endif // MCRL2_PROCESS_IS_LINEAR_H
bool operator!=(const unprotected_aterm_core &t) const
Inequality operator on two unprotected aterms.
Definition aterm_core.h:92
parse_node_unexpected_exception(const parser &p, const parse_node &node)
Definition parse.h:78
\brief Assignment of a data expression to a variable
Definition assignment.h:91
const data_expression & rhs() const
Definition assignment.h:122
const variable & lhs() const
Definition assignment.h:117
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:108
\brief A sort expression
\brief A data variable
Definition variable.h:28
const sort_expression & sort() const
Definition variable.h:43
logger(const log_level_t l)
Default constructor.
Definition logger.h:164
action_rename_rule(const data::variable_list &variables, const data::data_expression &condition, const process::action &lhs, const process::process_expression &rhs)
Constructor.
Read-only singly linked list of action rename rules.
process::action_label_list & action_labels()
Returns the sequence of action labels.
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:68
const data::assignment_list & assignments() const
Returns the sequence of assignments.
LPS summand containing a deadlock.
Represents a deadlock.
Definition deadlock.h:26
deadlock(data::data_expression time=data::undefined_real())
Constructor.
Definition deadlock.h:36
bool has_time() const
Returns true if time is available.
Definition deadlock.h:42
const data::data_expression & time() const
Returns the time.
Definition deadlock.h:49
data::data_expression & time()
Returns the time.
Definition deadlock.h:56
linear_process(const data::variable_list &process_parameters, const deadlock_summand_vector &deadlock_summands, const action_summand_vector &action_summands)
Constructor.
\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.
process_initializer & operator=(process_initializer &&) noexcept=default
Linear process specification.
LPS summand containing a multi-action.
\brief A stochastic distribution
stochastic_distribution & operator=(stochastic_distribution &&) noexcept=default
stochastic_distribution()
\brief Default constructor X3.
stochastic_distribution(const data::variable_list &variables, const data::data_expression &distribution)
\brief Constructor Z12.
stochastic_linear_process(const data::variable_list &process_parameters, const deadlock_summand_vector &deadlock_summands, const stochastic_action_summand_vector &action_summands)
Constructor.
stochastic_process_initializer(const data::data_expression_list &expressions, const stochastic_distribution &distribution)
Constructor.
\brief An action label
action(const action_label &label, const data::data_expression_list &arguments)
\brief Constructor Z14.
const data::data_expression_list & arguments() const
const action_label & label() const
\brief The allow operator
\brief The at operator
const data::data_expression & time_stamp() const
const process_expression & operand() const
\brief The block operator
\brief The bounded initialization
\brief The choice operator
const process_expression & left() const
const process_expression & right() const
\brief The communication operator
\brief The value delta
delta()
\brief Default constructor X3.
\brief The hide operator
\brief The if-then-else operator
\brief The if-then operator
const process_expression & then_case() const
const data::data_expression & condition() const
\brief The left merge operator
\brief The merge operator
\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(const process_expression &) noexcept=default
Move semantics.
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...
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 The rename operator
\brief The sequential composition
const process_expression & right() const
const process_expression & left() const
\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
const data::variable_list & variables() const
\brief The synchronization operator
const process_expression & left() const
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
runtime_error(const std::string &message)
Constructor.
Definition exception.h:31
D_ParserTables parser_tables_mcrl2
Definition dparser.cpp:20
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:391
The main namespace for the aterm++ library.
Definition algorithm.h:21
void syntax_error_fn(struct D_Parser *ap)
Custom syntax error function that prints both the line number and the column.
Definition dparser.cpp:463
D_ParseNode * ambiguity_fn(struct D_Parser *, int n, struct D_ParseNode **v)
Function for resolving parser ambiguities.
Definition dparser.cpp:332
bool sequence_empty_intersection(Sequence s1, Sequence s2)
Determines if the unordered sequences s1 and s2 have an empty intersection.
bool sequence_contains_duplicates(Iterator first, Iterator last)
Returns true if the sequence [first, last) contains duplicates.
static data_specification const & default_specification()
Definition parse.h:31
bool sequence_is_subset_of_set(Iterator first, Iterator last, const std::set< T > &s)
Returns true if all elements of the range [first, last) are element of the set s.
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.
bool sequences_do_overlap(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
Returns true if the two sequences [first1, last1) and [first2, last2) have a non empty intersection.
std::set< typename Container::value_type > make_set(const Container &c)
Makes a set of the given container.
Namespace for system defined sort bool_.
Definition bool.h:32
bool is_bool(const sort_expression &e)
Recogniser for sort expression Bool.
Definition bool.h:54
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:77
Namespace for system defined sort real_.
bool is_real(const sort_expression &e)
Recogniser for sort expression Real.
Definition real1.h:58
Namespace for all data library functionality.
Definition data.cpp:22
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
atermpp::term_list< variable > variable_list
\brief list of variables
atermpp::term_list< assignment > assignment_list
\brief list of assignments
Definition assignment.h:146
std::string pp(const data::variable_list &x)
Definition data.cpp:31
std::string pp(const data::data_expression &x)
Definition data.cpp:52
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:132
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:150
process::untyped_multi_action parse_multi_action_new(const std::string &text)
Definition lps.cpp:114
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:124
action_rename_specification parse_action_rename_specification_new(const std::string &text)
Definition lps.cpp:140
The main namespace for the LPS library.
Definition constelm.h:21
std::string pp(const lps::stochastic_process_initializer &x)
Definition lps.cpp:36
std::string pp(const lps::stochastic_distribution &x)
Definition lps.cpp:34
std::set< data::variable > find_all_variables(const lps::linear_process &x)
Definition lps.cpp:44
std::set< data::sort_expression > find_sort_expressions(const lps::stochastic_specification &x)
Definition lps.cpp:43
std::set< process::action_label > find_action_labels(const lps::stochastic_specification &x)
Definition lps.cpp:65
std::set< data::variable > find_free_variables(const lps::stochastic_specification &x)
Definition lps.cpp:53
std::vector< stochastic_action_summand > stochastic_action_summand_vector
\brief vector of stochastic_action_summands
std::string pp_with_summand_numbers(const specification &x)
Definition lps.cpp:74
std::string pp(const lps::process_initializer &x)
Definition lps.cpp:31
std::set< data::variable > find_all_variables(const lps::stochastic_specification &x)
Definition lps.cpp:47
bool check_well_typedness(const specification &x)
Definition lps.cpp:102
std::set< data::variable > find_free_variables(const lps::linear_process &x)
Definition lps.cpp:50
std::string pp(const lps::stochastic_specification &x)
Definition lps.cpp:37
bool check_well_typedness(const linear_process &x)
Definition lps.cpp:92
std::set< data::function_symbol > find_function_symbols(const lps::stochastic_specification &x)
Definition lps.cpp:59
std::string pp(const lps::linear_process &x)
Definition lps.cpp:29
std::vector< deadlock_summand > deadlock_summand_vector
\brief vector of deadlock_summands
std::string pp(const lps::deadlock &x)
Definition lps.cpp:27
std::set< process::action_label > find_action_labels(const lps::process_initializer &x)
Definition lps.cpp:63
std::string pp(const lps::multi_action &x)
Definition lps.cpp:30
std::set< data::variable > find_free_variables(const lps::specification &x)
Definition lps.cpp:52
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:128
std::string pp(const lps::specification &x)
Definition lps.cpp:32
void normalize_sorts(lps::specification &x, const data::sort_specification &)
Definition lps.cpp:39
std::set< data::variable > find_free_variables(const lps::deadlock &x)
Definition lps.cpp:54
std::set< process::action_label > find_action_labels(const lps::linear_process &x)
Definition lps.cpp:62
lps::multi_action normalize_sorts(const lps::multi_action &x, const data::sort_specification &sortspec)
Definition lps.cpp:38
std::set< data::variable > find_free_variables(const lps::stochastic_linear_process &x)
Definition lps.cpp:51
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:144
std::set< data::function_symbol > find_function_symbols(const lps::specification &x)
Definition lps.cpp:58
std::set< data::variable > find_free_variables(const lps::stochastic_process_initializer &x)
Definition lps.cpp:57
void normalize_sorts(T &x, const data::sort_specification &sortspec, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::set< data::variable > find_free_variables(const lps::multi_action &x)
Definition lps.cpp:55
std::string pp(const lps::deadlock_summand &x)
Definition lps.cpp:28
void normalize_sorts(lps::stochastic_specification &x, const data::sort_specification &)
Definition lps.cpp:40
std::set< data::variable > find_free_variables(const lps::process_initializer &x)
Definition lps.cpp:56
std::string pp(const lps::stochastic_linear_process &x)
Definition lps.cpp:35
std::set< data::variable > find_all_variables(const lps::multi_action &x)
Definition lps.cpp:49
T normalize_sorts(const T &x, const data::sort_specification &sortspec, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=0)
std::set< data::sort_expression > find_sort_expressions(const lps::specification &x)
Definition lps.cpp:42
std::vector< action_summand > action_summand_vector
\brief vector of action_summands
std::string pp(const lps::stochastic_action_summand &x)
Definition lps.cpp:33
std::set< data::variable > find_all_variables(const lps::specification &x)
Definition lps.cpp:46
bool check_well_typedness(const stochastic_specification &x)
Definition lps.cpp:107
std::set< data::variable > find_all_variables(const lps::deadlock &x)
Definition lps.cpp:48
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:157
std::set< data::variable > find_all_variables(const lps::stochastic_linear_process &x)
Definition lps.cpp:45
bool check_well_typedness(const stochastic_linear_process &x)
Definition lps.cpp:97
lps::multi_action translate_user_notation(const lps::multi_action &x)
Definition lps.cpp:41
std::set< core::identifier_string > find_identifiers(const lps::stochastic_specification &x)
Definition lps.cpp:61
std::string pp(const lps::action_summand &x)
Definition lps.cpp:26
std::set< core::identifier_string > find_identifiers(const lps::specification &x)
Definition lps.cpp:60
std::string pp_with_summand_numbers(const stochastic_specification &x)
Definition lps.cpp:83
std::set< process::action_label > find_action_labels(const lps::specification &x)
Definition lps.cpp:64
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:28
bool is_process(const process_expression &x)
Returns true if the argument is a process instance.
Definition is_linear.h:71
bool is_conditional_deadlock(const process_expression &x)
Returns true if the argument is a conditional deadlock.
Definition is_linear.h:131
bool is_linear_process_term(const process_expression &x)
Returns true if the argument is a linear process.
Definition is_linear.h:157
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:49
bool is_alternative(const process_expression &x)
Returns true if the argument is an alternative composition.
Definition is_linear.h:147
bool is_timed_deadlock(const process_expression &x)
Returns true if the argument is a deadlock.
Definition is_linear.h:96
bool is_action_prefix(const process_expression &x)
Returns true if the argument is an action prefix.
Definition is_linear.h:123
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:81
bool is_multiaction(const process_expression &x)
Returns true if the argument is a multi-action.
Definition is_linear.h:105
bool is_conditional_action_prefix(const process_expression &x)
Returns true if the argument is a conditional action prefix.
Definition is_linear.h:139
bool is_timed_multiaction(const process_expression &x)
Returns true if the argument is a multi-action.
Definition is_linear.h:115
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:347
std::string pp(const process::comm &x)
Definition process.cpp:43
bool is_linear(const process_expression &x, const process_equation &eqn)
Returns true if the process expression is linear.
Definition is_linear.h:392
bool is_process_instance(const atermpp::aterm &x)
std::string pp(const process::block &x)
Definition process.cpp:40
bool is_process_instance_assignment(const atermpp::aterm &x)
bool is_tau(const atermpp::aterm &x)
std::string pp(const process::process_instance &x)
Definition process.cpp:54
bool is_seq(const atermpp::aterm &x)
std::string pp(const process::process_instance_assignment &x)
Definition process.cpp:55
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:382
bool is_sum(const atermpp::aterm &x)
bool is_action(const atermpp::aterm &x)
std::string pp(const process::left_merge &x)
Definition process.cpp:49
std::string pp(const process::hide &x)
Definition process.cpp:46
atermpp::term_list< action_label > action_label_list
\brief list of action_labels
std::string pp(const process::allow &x)
Definition process.cpp:38
std::string pp(const process::if_then_else &x)
Definition process.cpp:48
atermpp::term_list< action > action_list
\brief list of actions
std::string pp(const process::rename &x)
Definition process.cpp:57
std::string pp(const process::process_expression &x)
Definition process.cpp:52
bool is_if_then(const atermpp::aterm &x)
std::string pp(const process::merge &x)
Definition process.cpp:50
std::string pp(const process::bounded_init &x)
Definition process.cpp:41
bool is_choice(const atermpp::aterm &x)
bool is_stochastic_operator(const atermpp::aterm &x)
std::string pp(const process::if_then &x)
Definition process.cpp:47
bool is_sync(const atermpp::aterm &x)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
core::identifier_string parse_Id(const parse_node &node) const
Definition parse.h:233
Wrapper for D_ParseNode.
Definition dparser.h:86
parse_node child(int i) const
Definition dparser.cpp:43
int child_count() const
Definition dparser.cpp:37
std::string symbol_name(const parse_node &node) const
Definition parse.h:205
const parser & m_parser
Definition parse.h:85
Wrapper for D_Parser and its corresponding D_ParserTables.
Definition dparser.h:148
parse_node parse(const std::string &text, unsigned int start_symbol_index=0, bool partial_parses=false)
Parses a string. N.B. The user is responsible for destruction of the returned value by calling destro...
Definition dparser.cpp:209
parser(D_ParserTables &tables, D_AmbiguityFn ambiguity_fn=nullptr, D_SyntaxErrorFn syntax_error_fn=nullptr, std::size_t max_error_message_count=1)
Definition dparser.cpp:174
unsigned int start_symbol_index(const std::string &name) const
Definition dparser.cpp:204
Substitution that maps data variables to data expressions. The substitution is stored as an assignmen...
assignment_sequence_substitution(const assignment_list &assignments_)
data::data_expression parse_DataExpr(const core::parse_node &node) const
Definition parse_impl.h:211
bool callback_DataSpecElement(const core::parse_node &node, untyped_data_specification &result) const
Definition parse_impl.h:413
normalize_sorts_function(const sort_specification &sort_spec)
std::vector< lps::action_rename_rule > parse_ActionRenameRuleList(const core::parse_node &node) const
Definition parse_impl.h:75
process::action parse_Action_as_action(const core::parse_node &node) const
Definition parse_impl.h:51
bool callback_ActionRenameSpec(const core::parse_node &node, data::untyped_data_specification &dataspec_result, lps::action_rename_specification &result) const
Definition parse_impl.h:91
std::vector< lps::action_rename_rule > parse_ActionRenameRuleSpec(const core::parse_node &node) const
Definition parse_impl.h:80
lps::action_rename_specification parse_ActionRenameSpec(const core::parse_node &node) const
Definition parse_impl.h:123
process::process_expression parse_ActionRenameRuleRHS(const core::parse_node &node) const
Definition parse_impl.h:57
action_rename_actions(const core::parser &parser_)
Definition parse_impl.h:46
lps::action_rename_rule parse_ActionRenameRule(const core::parse_node &node) const
Definition parse_impl.h:65
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:33
multi_action_actions(const core::parser &parser_)
Definition parse_impl.h:29
action_actions(const core::parser &parser_)
Definition parse_impl.h:47
Converts a process expression into linear process format. Use the convert member functions for this.
process_expression_traverser< linear_process_conversion_traverser > super
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 &)
Returns true if the process equation e is linear.
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:178
Checks if a process equation is linear. Use the is_linear() member function for this.
Definition is_linear.h:167
process_expression_traverser< linear_process_expression_traverser > super
Definition is_linear.h:168
linear_process_expression_traverser(const process_equation &eqn_=process_equation())
Definition is_linear.h:184
void enter(const process::process_instance &x)
Definition is_linear.h:189
process_equation eqn
The process equation that is checked.
Definition is_linear.h:174
bool is_linear(const process_expression &x, bool verbose=false)
Returns true if the process equation e is linear.
Definition is_linear.h:325
void enter(const process::process_instance_assignment &x)
Definition is_linear.h:197
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.
void convert(const process_equation &)
Returns true if the process equation e is linear.
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.
process_expression_traverser< stochastic_linear_process_conversion_traverser > super
lps::stochastic_specification convert(const process_specification &p)
Converts a process_specification into a stochastic_specification. Throws non_linear_process if a non-...
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const