mCRL2
Loading...
Searching...
No Matches
function_symbol.h
Go to the documentation of this file.
1// Author(s): Jeroen Keiren
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//
11
12#ifndef MCRL2_DATA_FUNCTION_SYMBOL_H
13#define MCRL2_DATA_FUNCTION_SYMBOL_H
14
16
17namespace mcrl2
18{
19
20namespace data
21{
22
23typedef std::pair<core::identifier_string, sort_expression> function_symbol_key_type;
24
25//--- start generated class function_symbol ---//
28{
29 public:
30
31
33 function_symbol(const function_symbol&) noexcept = default;
34 function_symbol(function_symbol&&) noexcept = default;
35 function_symbol& operator=(const function_symbol&) noexcept = default;
36 function_symbol& operator=(function_symbol&&) noexcept = default;
37
38 const core::identifier_string& name() const
39 {
40 return atermpp::down_cast<core::identifier_string>((*this)[0]);
41 }
42
43 const sort_expression& sort() const
44 {
45 return atermpp::down_cast<sort_expression>((*this)[1]);
46 }
47//--- start user section function_symbol ---//
50 : data_expression(core::detail::default_values::OpId)
51 {}
52
55 explicit function_symbol(const atermpp::aterm& term)
56 : data_expression(term)
57 {
58 assert(core::detail::check_term_OpId(*this));
59 }
60
63 {
64 atermpp::make_term_appl_with_index<function_symbol, std::pair<core::identifier_string, sort_expression> >
66 }
67
68
70 function_symbol(const std::string& name, const sort_expression& sort)
71 {
72 atermpp::make_term_appl_with_index<function_symbol, std::pair<core::identifier_string, sort_expression> >
74 }
75
76//--- end user section function_symbol ---//
77};
78
81template <class... ARGUMENTS>
82inline void make_function_symbol(atermpp::aterm& t, const ARGUMENTS&... args)
83{
84 atermpp::make_term_appl_with_index<function_symbol,std::pair<core::identifier_string, sort_expression>>(t, core::detail::function_symbol_OpId(), args...);
85}
86
89
91typedef std::vector<function_symbol> function_symbol_vector;
92
93// prototype declaration
94std::string pp(const function_symbol& x);
95
100inline
101std::ostream& operator<<(std::ostream& out, const function_symbol& x)
102{
103 return out << data::pp(x);
104}
105
108{
109 t1.swap(t2);
110}
111//--- end generated class function_symbol ---//
112
113// template function overloads
114std::string pp(const function_symbol_list& x);
115std::string pp(const function_symbol_vector& x);
116std::set<data::variable> find_all_variables(const data::function_symbol& x);
117
118} // namespace data
119
120} // namespace mcrl2
121
122#endif // MCRL2_DATA_FUNCTION_SYMBOL_H
123
The class application.
Term containing a string.
A list of aterm objects.
Definition aterm_list.h:24
void swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
Definition aterm_core.h:152
\brief A function symbol
function_symbol(const core::identifier_string &name, const sort_expression &sort)
Constructor.
function_symbol(const function_symbol &) noexcept=default
Move semantics.
function_symbol()
Default constructor.
function_symbol(function_symbol &&) noexcept=default
function_symbol(const atermpp::aterm &term)
Constructor.
const core::identifier_string & name() const
const sort_expression & sort() const
function_symbol(const std::string &name, const sort_expression &sort)
Constructor.
\brief A sort expression
bool check_term_OpId(const Term &t)
const atermpp::function_symbol & function_symbol_OpId()
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
void make_function_symbol(atermpp::aterm &t, const ARGUMENTS &... args)
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
atermpp::term_list< function_symbol > function_symbol_list
\brief list of function_symbols
std::set< data::variable > find_all_variables(const data::data_expression &x)
Definition data.cpp:94
std::string pp(const abstraction &x)
Definition data.cpp:39
std::pair< core::identifier_string, sort_expression > function_symbol_key_type
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
std::ostream & operator<<(std::ostream &out, const abstraction &x)
Definition abstraction.h:94
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72