12#ifndef MCRL2_PBES_TRAVERSER_H
13#define MCRL2_PBES_TRAVERSER_H
15#include "mcrl2/pbes/pbes.h"
21template <
typename Derived>
31 static_cast<Derived&>(*
this).enter(x);
33 static_cast<Derived&>(*
this).leave(x);
38 static_cast<Derived&>(*
this).enter(x);
40 static_cast<Derived&>(*
this).leave(x);
45template <
template <
class>
class Traverser,
class Derived>
48 using super = Traverser<Derived>;
55 static_cast<Derived&>(*
this).enter(x);
57 static_cast<Derived&>(*
this).leave(x);
62 static_cast<Derived&>(*
this).enter(x);
64 static_cast<Derived&>(*
this).apply(x
.formula());
65 static_cast<Derived&>(*
this).leave(x);
70 static_cast<Derived&>(*
this).enter(x);
71 static_cast<Derived&>(*
this).apply(x.global_variables());
72 static_cast<Derived&>(*
this).apply(x.equations());
74 static_cast<Derived&>(*
this).leave(x);
79 static_cast<Derived&>(*
this).enter(x);
81 static_cast<Derived&>(*
this).leave(x);
86 static_cast<Derived&>(*
this).enter(x);
87 static_cast<Derived&>(*
this).apply(x
.operand());
88 static_cast<Derived&>(*
this).leave(x);
93 static_cast<Derived&>(*
this).enter(x);
94 static_cast<Derived&>(*
this).apply(x
.left());
95 static_cast<Derived&>(*
this).apply(x
.right());
96 static_cast<Derived&>(*
this).leave(x);
101 static_cast<Derived&>(*
this).enter(x);
102 static_cast<Derived&>(*
this).apply(x
.left());
103 static_cast<Derived&>(*
this).apply(x
.right());
104 static_cast<Derived&>(*
this).leave(x);
109 static_cast<Derived&>(*
this).enter(x);
110 static_cast<Derived&>(*
this).apply(x
.left());
111 static_cast<Derived&>(*
this).apply(x
.right());
112 static_cast<Derived&>(*
this).leave(x);
117 static_cast<Derived&>(*
this).enter(x);
119 static_cast<Derived&>(*
this).apply(x
.body());
120 static_cast<Derived&>(*
this).leave(x);
125 static_cast<Derived&>(*
this).enter(x);
127 static_cast<Derived&>(*
this).apply(x
.body());
128 static_cast<Derived&>(*
this).leave(x);
133 static_cast<Derived&>(*
this).enter(x);
136 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::data_expression>(x));
140 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::untyped_data_parameter>(x));
144 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::propositional_variable_instantiation>(x));
148 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::not_>(x));
152 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::and_>(x));
156 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::or_>(x));
160 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::imp>(x));
164 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::forall>(x));
168 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::exists>(x));
170 static_cast<Derived&>(*
this).leave(x);
176template <
typename Derived>
183template <
template <
class>
class Traverser,
class Derived>
186 using super = Traverser<Derived>;
193 static_cast<Derived&>(*
this).enter(x);
194 static_cast<Derived&>(*
this).apply(x
.formula());
195 static_cast<Derived&>(*
this).leave(x);
200 static_cast<Derived&>(*
this).enter(x);
201 static_cast<Derived&>(*
this).apply(x.equations());
203 static_cast<Derived&>(*
this).leave(x);
208 static_cast<Derived&>(*
this).enter(x);
210 static_cast<Derived&>(*
this).leave(x);
215 static_cast<Derived&>(*
this).enter(x);
216 static_cast<Derived&>(*
this).apply(x
.operand());
217 static_cast<Derived&>(*
this).leave(x);
222 static_cast<Derived&>(*
this).enter(x);
223 static_cast<Derived&>(*
this).apply(x
.left());
224 static_cast<Derived&>(*
this).apply(x
.right());
225 static_cast<Derived&>(*
this).leave(x);
230 static_cast<Derived&>(*
this).enter(x);
231 static_cast<Derived&>(*
this).apply(x
.left());
232 static_cast<Derived&>(*
this).apply(x
.right());
233 static_cast<Derived&>(*
this).leave(x);
238 static_cast<Derived&>(*
this).enter(x);
239 static_cast<Derived&>(*
this).apply(x
.left());
240 static_cast<Derived&>(*
this).apply(x
.right());
241 static_cast<Derived&>(*
this).leave(x);
246 static_cast<Derived&>(*
this).enter(x);
247 static_cast<Derived&>(*
this).apply(x
.body());
248 static_cast<Derived&>(*
this).leave(x);
253 static_cast<Derived&>(*
this).enter(x);
254 static_cast<Derived&>(*
this).apply(x
.body());
255 static_cast<Derived&>(*
this).leave(x);
260 static_cast<Derived&>(*
this).enter(x);
263 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::data_expression>(x));
267 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::untyped_data_parameter>(x));
271 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::propositional_variable_instantiation>(x));
275 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::not_>(x));
279 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::and_>(x));
283 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::or_>(x));
287 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::imp>(x));
291 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::forall>(x));
295 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::exists>(x));
297 static_cast<Derived&>(*
this).leave(x);
303template <
typename Derived>
310template <
template <
class>
class Traverser,
class Derived>
313 using super = Traverser<Derived>;
320 static_cast<Derived&>(*
this).enter(x);
321 static_cast<Derived&>(*
this).apply(x
.formula());
322 static_cast<Derived&>(*
this).leave(x);
327 static_cast<Derived&>(*
this).enter(x);
328 static_cast<Derived&>(*
this).apply(x.equations());
329 static_cast<Derived&>(*
this).leave(x);
334 static_cast<Derived&>(*
this).enter(x);
336 static_cast<Derived&>(*
this).leave(x);
341 static_cast<Derived&>(*
this).enter(x);
342 static_cast<Derived&>(*
this).apply(x
.operand());
343 static_cast<Derived&>(*
this).leave(x);
348 static_cast<Derived&>(*
this).enter(x);
349 static_cast<Derived&>(*
this).apply(x
.left());
350 static_cast<Derived&>(*
this).apply(x
.right());
351 static_cast<Derived&>(*
this).leave(x);
356 static_cast<Derived&>(*
this).enter(x);
357 static_cast<Derived&>(*
this).apply(x
.left());
358 static_cast<Derived&>(*
this).apply(x
.right());
359 static_cast<Derived&>(*
this).leave(x);
364 static_cast<Derived&>(*
this).enter(x);
365 static_cast<Derived&>(*
this).apply(x
.left());
366 static_cast<Derived&>(*
this).apply(x
.right());
367 static_cast<Derived&>(*
this).leave(x);
372 static_cast<Derived&>(*
this).enter(x);
373 static_cast<Derived&>(*
this).apply(x
.body());
374 static_cast<Derived&>(*
this).leave(x);
379 static_cast<Derived&>(*
this).enter(x);
380 static_cast<Derived&>(*
this).apply(x
.body());
381 static_cast<Derived&>(*
this).leave(x);
386 static_cast<Derived&>(*
this).enter(x);
389 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::data_expression>(x));
393 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::untyped_data_parameter>(x));
397 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::propositional_variable_instantiation>(x));
401 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::not_>(x));
405 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::and_>(x));
409 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::or_>(x));
413 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::imp>(x));
417 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::forall>(x));
421 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::exists>(x));
423 static_cast<Derived&>(*
this).leave(x);
429template <
typename Derived>
436template <
template <
class>
class Traverser,
class Derived>
439 using super = Traverser<Derived>;
446 static_cast<Derived&>(*
this).enter(x);
448 static_cast<Derived&>(*
this).leave(x);
453 static_cast<Derived&>(*
this).enter(x);
455 static_cast<Derived&>(*
this).apply(x
.formula());
456 static_cast<Derived&>(*
this).leave(x);
461 static_cast<Derived&>(*
this).enter(x);
462 static_cast<Derived&>(*
this).apply(x.global_variables());
463 static_cast<Derived&>(*
this).apply(x.equations());
465 static_cast<Derived&>(*
this).leave(x);
470 static_cast<Derived&>(*
this).enter(x);
472 static_cast<Derived&>(*
this).leave(x);
477 static_cast<Derived&>(*
this).enter(x);
478 static_cast<Derived&>(*
this).apply(x
.operand());
479 static_cast<Derived&>(*
this).leave(x);
484 static_cast<Derived&>(*
this).enter(x);
485 static_cast<Derived&>(*
this).apply(x
.left());
486 static_cast<Derived&>(*
this).apply(x
.right());
487 static_cast<Derived&>(*
this).leave(x);
492 static_cast<Derived&>(*
this).enter(x);
493 static_cast<Derived&>(*
this).apply(x
.left());
494 static_cast<Derived&>(*
this).apply(x
.right());
495 static_cast<Derived&>(*
this).leave(x);
500 static_cast<Derived&>(*
this).enter(x);
501 static_cast<Derived&>(*
this).apply(x
.left());
502 static_cast<Derived&>(*
this).apply(x
.right());
503 static_cast<Derived&>(*
this).leave(x);
508 static_cast<Derived&>(*
this).enter(x);
510 static_cast<Derived&>(*
this).apply(x
.body());
511 static_cast<Derived&>(*
this).leave(x);
516 static_cast<Derived&>(*
this).enter(x);
518 static_cast<Derived&>(*
this).apply(x
.body());
519 static_cast<Derived&>(*
this).leave(x);
524 static_cast<Derived&>(*
this).enter(x);
527 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::data_expression>(x));
531 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::untyped_data_parameter>(x));
535 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::propositional_variable_instantiation>(x));
539 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::not_>(x));
543 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::and_>(x));
547 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::or_>(x));
551 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::imp>(x));
555 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::forall>(x));
559 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::exists>(x));
561 static_cast<Derived&>(*
this).leave(x);
567template <
typename Derived>
574template <
template <
class>
class Traverser,
class Derived>
577 using super = Traverser<Derived>;
584 static_cast<Derived&>(*
this).enter(x);
585 static_cast<Derived&>(*
this).apply(x
.name());
587 static_cast<Derived&>(*
this).leave(x);
592 static_cast<Derived&>(*
this).enter(x);
594 static_cast<Derived&>(*
this).apply(x
.formula());
595 static_cast<Derived&>(*
this).leave(x);
600 static_cast<Derived&>(*
this).enter(x);
601 static_cast<Derived&>(*
this).apply(x.global_variables());
602 static_cast<Derived&>(*
this).apply(x.equations());
604 static_cast<Derived&>(*
this).leave(x);
609 static_cast<Derived&>(*
this).enter(x);
610 static_cast<Derived&>(*
this).apply(x
.name());
612 static_cast<Derived&>(*
this).leave(x);
617 static_cast<Derived&>(*
this).enter(x);
618 static_cast<Derived&>(*
this).apply(x
.operand());
619 static_cast<Derived&>(*
this).leave(x);
624 static_cast<Derived&>(*
this).enter(x);
625 static_cast<Derived&>(*
this).apply(x
.left());
626 static_cast<Derived&>(*
this).apply(x
.right());
627 static_cast<Derived&>(*
this).leave(x);
632 static_cast<Derived&>(*
this).enter(x);
633 static_cast<Derived&>(*
this).apply(x
.left());
634 static_cast<Derived&>(*
this).apply(x
.right());
635 static_cast<Derived&>(*
this).leave(x);
640 static_cast<Derived&>(*
this).enter(x);
641 static_cast<Derived&>(*
this).apply(x
.left());
642 static_cast<Derived&>(*
this).apply(x
.right());
643 static_cast<Derived&>(*
this).leave(x);
648 static_cast<Derived&>(*
this).enter(x);
650 static_cast<Derived&>(*
this).apply(x
.body());
651 static_cast<Derived&>(*
this).leave(x);
656 static_cast<Derived&>(*
this).enter(x);
658 static_cast<Derived&>(*
this).apply(x
.body());
659 static_cast<Derived&>(*
this).leave(x);
664 static_cast<Derived&>(*
this).enter(x);
667 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::data_expression>(x));
671 static_cast<Derived&>(*
this).apply(atermpp::down_cast<data::untyped_data_parameter>(x));
675 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::propositional_variable_instantiation>(x));
679 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::not_>(x));
683 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::and_>(x));
687 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::or_>(x));
691 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::imp>(x));
695 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::forall>(x));
699 static_cast<Derived&>(*
this).apply(atermpp::down_cast<pbes_system::exists>(x));
701 static_cast<Derived&>(*
this).leave(x);
707template <
typename Derived>
\brief An untyped parameter
\brief The and operator for pbes expressions
const pbes_expression & left() const
const pbes_expression & right() const
\brief The existential quantification operator for pbes expressions
const data::variable_list & variables() const
const pbes_expression & body() const
\brief The universal quantification operator for pbes expressions
const pbes_expression & body() const
const data::variable_list & variables() const
\brief The implication operator for pbes expressions
const pbes_expression & left() const
const pbes_expression & right() const
\brief The not operator for pbes expressions
const pbes_expression & operand() const
\brief The or operator for pbes expressions
const pbes_expression & left() const
const pbes_expression & right() const
const pbes_expression & formula() const
Returns the predicate formula on the right hand side of the equation.
bool is_solved() const
Returns true if the predicate formula on the right hand side contains no predicate variables.
const propositional_variable & variable() const
Returns the pbes variable of the equation.
parameterized boolean equation system
const propositional_variable_instantiation & initial_state() const
Returns the initial state.
std::set< propositional_variable_instantiation > occurring_variable_instantiations() const
Returns the set of occurring propositional variable instantiations of the pbes. This is the set of va...
\brief A propositional variable instantiation
const data::data_expression_list & parameters() const
const core::identifier_string & name() const
\brief A propositional variable declaration
const data::variable_list & parameters() const
const core::identifier_string & name() const
D_ParserTables parser_tables_mcrl2
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
bool is_untyped_data_parameter(const atermpp::aterm &x)
void instantiate_global_variables(pbes &p)
Attempts to eliminate the free variables of a PBES, by substituting a constant value for them....
bool is_bes(const pbes &x)
Returns true if a PBES is in BES form.
untyped_pbes parse_pbes_new(const std::string &text)
void complete_pbes(pbes &x)
bool has_propositional_variables(const pbes_expression &x)
propositional_variable parse_propositional_variable(const std::string &text)
pbes_expression parse_pbes_expression(const std::string &text)
bool is_well_typed(const pbes_equation &eqn)
Checks if the equation is well typed.
pbes_expression parse_pbes_expression_new(const std::string &text)
The main namespace for the PBES library.
std::set< data::variable > find_free_variables(const pbes_system::pbes_equation &x)
std::string pp(const pbes_system::propositional_variable_list &x, bool arg0)
std::string pp(const pbes_system::or_ &x, bool arg0)
std::set< data::variable > find_free_variables(const pbes_system::pbes &x)
void normalize_sorts(pbes_system::pbes_equation_vector &x, const data::sort_specification &sortspec)
std::string pp(const pbes_system::imp &x, bool arg0)
std::string pp(const pbes_system::propositional_variable_instantiation_list &x, bool arg0)
pbes_system::pbes_expression normalize_sorts(const pbes_system::pbes_expression &x, const data::sort_specification &sortspec)
std::set< data::sort_expression > find_sort_expressions(const pbes_system::pbes &x)
std::string pp(const pbes_system::pbes_equation_vector &x, bool arg0)
std::string pp(const pbes_system::pbes_expression_list &x, bool arg0)
bool is_not(const atermpp::aterm &x)
std::set< pbes_system::propositional_variable_instantiation > find_propositional_variable_instantiations(const pbes_system::pbes_expression &x)
bool is_exists(const atermpp::aterm &x)
void normalize_sorts(pbes_system::pbes &x, const data::sort_specification &)
bool is_or(const atermpp::aterm &x)
bool is_well_typed_pbes(const std::set< data::sort_expression > &declared_sorts, const std::set< data::variable > &declared_global_variables, const std::set< data::variable > &occurring_global_variables, const std::set< propositional_variable > &declared_variables, const std::set< propositional_variable_instantiation > &occ, const propositional_variable_instantiation &init, const data::data_specification &data_spec)
std::set< data::function_symbol > find_function_symbols(const pbes_system::pbes &x)
bool is_forall(const atermpp::aterm &x)
void typecheck_pbes(pbes &pbesspec)
Type check a parsed mCRL2 pbes specification. Throws an exception if something went wrong.
std::string pp(const pbes_system::propositional_variable &x, bool arg0)
std::string pp(const pbes_system::exists &x, bool arg0)
std::string pp(const pbes_system::pbes_expression &x, bool arg0)
bool is_well_typed(const pbes_equation &eqn)
std::set< data::variable > find_free_variables(const pbes_system::pbes_expression &x)
pbes_system::pbes_expression translate_user_notation(const pbes_system::pbes_expression &x)
bool search_variable(const pbes_system::pbes_expression &x, const data::variable &v)
std::set< data::variable > find_all_variables(const pbes_system::pbes &x)
std::string pp(const pbes_system::not_ &x, bool arg0)
void complete_data_specification(pbes &)
Adds all sorts that appear in the PBES p to the data specification of p.
std::string pp(const pbes_system::pbes_equation &x, bool arg0)
std::set< core::identifier_string > find_identifiers(const pbes_system::pbes_expression &x)
bool is_propositional_variable_instantiation(const atermpp::aterm &x)
bool is_well_typed_equation(const pbes_equation &eqn, const std::set< data::sort_expression > &declared_sorts, const std::set< data::variable > &declared_global_variables, const data::data_specification &data_spec)
std::string pp(const pbes_system::propositional_variable_instantiation &x, bool arg0)
bool is_and(const atermpp::aterm &x)
void translate_user_notation(pbes_system::pbes &x)
std::string pp(const pbes_system::pbes &x, bool arg0)
bool is_imp(const atermpp::aterm &x)
std::string pp(const pbes_system::and_ &x, bool arg0)
std::string pp(const pbes_system::fixpoint_symbol &x, bool arg0)
std::string pp(const pbes_system::forall &x, bool arg0)
expression traverser that visits all sub expressions
void apply(const pbes_system::imp &x)
void apply(const pbes_system::not_ &x)
void apply(const pbes_system::propositional_variable_instantiation &x)
void apply(const pbes_system::exists &x)
void apply(const pbes_system::pbes &x)
void apply(const pbes_system::pbes_equation &x)
void apply(const pbes_system::pbes_expression &x)
void apply(const pbes_system::or_ &x)
void apply(const pbes_system::and_ &x)
void apply(const pbes_system::forall &x)
void apply(const pbes_system::pbes &x)
void apply(const pbes_system::pbes_expression &x)
void apply(const pbes_system::exists &x)
void apply(const pbes_system::and_ &x)
void apply(const pbes_system::not_ &x)
void apply(const pbes_system::propositional_variable &x)
void apply(const pbes_system::imp &x)
void apply(const pbes_system::forall &x)
void apply(const pbes_system::or_ &x)
void apply(const pbes_system::pbes_equation &x)
void apply(const pbes_system::propositional_variable_instantiation &x)
void apply(const pbes_system::propositional_variable_instantiation &x)
void apply(const pbes_system::and_ &x)
void apply(const pbes_system::forall &x)
void apply(const pbes_system::pbes_equation &x)
void apply(const pbes_system::or_ &x)
void apply(const pbes_system::imp &x)
void apply(const pbes_system::pbes_expression &x)
void apply(const pbes_system::exists &x)
void apply(const pbes_system::not_ &x)
void apply(const pbes_system::pbes &x)
void apply(const pbes_system::exists &x)
void apply(const pbes_system::or_ &x)
void apply(const pbes_system::propositional_variable_instantiation &x)
void apply(const pbes_system::propositional_variable &x)
void apply(const pbes_system::imp &x)
void apply(const pbes_system::and_ &x)
void apply(const pbes_system::pbes &x)
void apply(const pbes_system::forall &x)
void apply(const pbes_system::pbes_equation &x)
void apply(const pbes_system::pbes_expression &x)
void apply(const pbes_system::not_ &x)
void apply(const pbes_system::pbes &x)
void apply(const pbes_system::propositional_variable &x)
void apply(const pbes_system::or_ &x)
void apply(const pbes_system::propositional_variable_instantiation &x)
void apply(const pbes_system::not_ &x)
void apply(const pbes_system::exists &x)
void apply(const pbes_system::and_ &x)
void apply(const pbes_system::imp &x)
void apply(const pbes_system::pbes_expression &x)
void apply(const pbes_system::pbes_equation &x)
void apply(const pbes_system::forall &x)
void enter(const propositional_variable_instantiation &)
pbes_system::propositional_variable parse_PropVarDecl(const core::parse_node &node) const
pbes_actions(const core::parser &parser_)
untyped_pbes parse_PbesSpec(const core::parse_node &node) const
pbes_system::pbes_expression parse_PbesExpr(const core::parse_node &node) const
Traversal class for pbes_expressions. Used as a base class for pbes_expression_traverser.
void apply(const data::data_expression &x)
void apply(const data::untyped_data_parameter &x)