mCRL2
Loading...
Searching...
No Matches
data_functional.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//
11
12#ifndef MCRL2_DATA_DETAIL_DATA_FUNCTIONAL_H
13#define MCRL2_DATA_DETAIL_DATA_FUNCTIONAL_H
14
17
18namespace mcrl2
19{
20
21namespace data
22{
23
24namespace detail
25{
26
27template <typename Term>
29{
30 const Term& term;
31
32 compare_term(const Term& t)
33 : term(t)
34 {}
35
39 template <typename Term2>
40 bool operator()(Term2 t) const
41 {
42 return term == t;
43 }
44};
45
48{
50
52 : s(s_)
53 {}
54
55 bool operator()(const atermpp::aterm& t) const
56 {
57 return is_sort_expression(t) && s == t;
58 }
59};
60
62struct compare_variable: public compare_term<variable>
63{
66 {}
67};
68
71{
76 {
77 return v.name();
78 }
79};
80
82template < typename Expression >
84{
88 sort_expression operator()(const Expression& e) const
89 {
90 return e.sort();
91 }
92};
93
96
98{
99 std::string m_name;
100
101 sort_has_name(std::string const& name)
102 : m_name(name)
103 {}
104
108 bool operator()(const sort_expression& s) const
109 {
110 return is_basic_sort(s) && std::string(basic_sort(s).name()) == m_name;
111 }
112};
113
115{
116 std::string m_name;
117
118 function_symbol_has_name(std::string const& name)
119 : m_name(name)
120 {}
121
125 bool operator()(const function_symbol& c) const
126 {
127 return std::string(c.name()) == m_name;
128 }
129};
130
131} // namespace detail
132
133} // namespace data
134
135} // namespace mcrl2
136
137#endif // MCRL2_DATA_DETAIL_DATA_FUNCTIONAL_H
The class basic_sort.
Term containing a string.
\brief A basic sort
Definition basic_sort.h:26
\brief A function symbol
const core::identifier_string & name() const
\brief A sort expression
\brief A data variable
Definition variable.h:28
const core::identifier_string & name() const
Definition variable.h:38
The class function symbol.
sort_of_expression< variable > sort_of_variable
Function object that returns the sort of a data variable.
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
bool is_sort_expression(const atermpp::aterm &x)
Test for a sort_expression expression.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Tests if a term is a sort, and if it is equal to s.
bool operator()(const atermpp::aterm &t) const
bool operator()(Term2 t) const
Function call operator.
Function object that determines if a term is equal to a given data variable.
bool operator()(const function_symbol &c) const
Function call operator.
bool operator()(const sort_expression &s) const
Function call operator.
sort_has_name(std::string const &name)
Function object that returns the sort of a data expression.
sort_expression operator()(const Expression &e) const
Function call operator.
Function object that returns the name of a data variable.
core::identifier_string operator()(const variable &v) const
Function call operator.