Line data Source code
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/process_equation.h 10 : /// \brief add your file description here. 11 : 12 : #ifndef MCRL2_PROCESS_PROCESS_EQUATION_H 13 : #define MCRL2_PROCESS_PROCESS_EQUATION_H 14 : 15 : #include "mcrl2/process/process_expression.h" 16 : 17 : namespace mcrl2 18 : { 19 : 20 : namespace process 21 : { 22 : 23 : //--- start generated class process_equation ---// 24 : /// \\brief A process equation 25 : class process_equation: public atermpp::aterm_appl 26 : { 27 : public: 28 : /// \\brief Default constructor. 29 2459 : process_equation() 30 2459 : : atermpp::aterm_appl(core::detail::default_values::ProcEqn) 31 2459 : {} 32 : 33 : /// \\brief Constructor. 34 : /// \\param term A term 35 : explicit process_equation(const atermpp::aterm& term) 36 : : atermpp::aterm_appl(term) 37 : { 38 : assert(core::detail::check_term_ProcEqn(*this)); 39 : } 40 : 41 : /// \\brief Constructor. 42 2293 : process_equation(const process_identifier& identifier, const data::variable_list& formal_parameters, const process_expression& expression) 43 2293 : : atermpp::aterm_appl(core::detail::function_symbol_ProcEqn(), identifier, formal_parameters, expression) 44 2293 : {} 45 : 46 : /// Move semantics 47 4264 : process_equation(const process_equation&) noexcept = default; 48 1575 : process_equation(process_equation&&) noexcept = default; 49 2461 : process_equation& operator=(const process_equation&) noexcept = default; 50 1146 : process_equation& operator=(process_equation&&) noexcept = default; 51 : 52 11100 : const process_identifier& identifier() const 53 : { 54 11100 : return atermpp::down_cast<process_identifier>((*this)[0]); 55 : } 56 : 57 7474 : const data::variable_list& formal_parameters() const 58 : { 59 7474 : return atermpp::down_cast<data::variable_list>((*this)[1]); 60 : } 61 : 62 6499 : const process_expression& expression() const 63 : { 64 6499 : return atermpp::down_cast<process_expression>((*this)[2]); 65 : } 66 : }; 67 : 68 : /// \\brief Make_process_equation constructs a new term into a given address. 69 : /// \\ \param t The reference into which the new process_equation is constructed. 70 : template <class... ARGUMENTS> 71 2285 : inline void make_process_equation(atermpp::aterm_appl& t, const ARGUMENTS&... args) 72 : { 73 2285 : atermpp::make_term_appl(t, core::detail::function_symbol_ProcEqn(), args...); 74 2285 : } 75 : 76 : /// \\brief list of process_equations 77 : typedef atermpp::term_list<process_equation> process_equation_list; 78 : 79 : /// \\brief vector of process_equations 80 : typedef std::vector<process_equation> process_equation_vector; 81 : 82 : /// \\brief Test for a process_equation expression 83 : /// \\param x A term 84 : /// \\return True if \\a x is a process_equation expression 85 : inline 86 : bool is_process_equation(const atermpp::aterm_appl& x) 87 : { 88 : return x.function() == core::detail::function_symbols::ProcEqn; 89 : } 90 : 91 : // prototype declaration 92 : std::string pp(const process_equation& x); 93 : 94 : /// \\brief Outputs the object to a stream 95 : /// \\param out An output stream 96 : /// \\param x Object x 97 : /// \\return The output stream 98 : inline 99 : std::ostream& operator<<(std::ostream& out, const process_equation& x) 100 : { 101 : return out << process::pp(x); 102 : } 103 : 104 : /// \\brief swap overload 105 : inline void swap(process_equation& t1, process_equation& t2) 106 : { 107 : t1.swap(t2); 108 : } 109 : //--- end generated class process_equation ---// 110 : 111 : // template function overloads 112 : std::string pp(const process_equation_list& x); 113 : std::string pp(const process_equation_vector& x); 114 : void normalize_sorts(process_equation_vector& x, const data::sort_specification& sortspec); 115 : std::set<data::sort_expression> find_sort_expressions(const process::process_equation_vector& x); 116 : 117 : } // namespace process 118 : 119 : } // namespace mcrl2 120 : 121 : #endif // MCRL2_PROCESS_PROCESS_EQUATION_H