mCRL2
Loading...
Searching...
No Matches
find.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_PBES_FIND_H
13#define MCRL2_PBES_FIND_H
14
17
18namespace mcrl2
19{
20
21namespace pbes_system
22{
23
24namespace detail
25{
26
27template <template <class> class Traverser, class OutputIterator>
28struct find_propositional_variables_traverser: public Traverser<find_propositional_variables_traverser<Traverser, OutputIterator> >
29{
30 typedef Traverser<find_propositional_variables_traverser<Traverser, OutputIterator> > super;
31 using super::enter;
32 using super::leave;
33 using super::apply;
34
35 OutputIterator out;
36
38 : out(out_)
39 {}
40
41 // instead of deriving from a traverser in the data library
43 {}
44
46 {
47 *out = v;
48 }
49};
50
51template <template <class> class Traverser, class OutputIterator>
52find_propositional_variables_traverser<Traverser, OutputIterator>
54{
56}
57
58} // namespace detail
59
60//--- start generated pbes_system find code ---//
65template <typename T, typename OutputIterator>
66void find_all_variables(const T& x, OutputIterator o)
67{
68 data::detail::make_find_all_variables_traverser<pbes_system::variable_traverser>(o).apply(x);
69}
70
74template <typename T>
75std::set<data::variable> find_all_variables(const T& x)
76{
77 std::set<data::variable> result;
78 pbes_system::find_all_variables(x, std::inserter(result, result.end()));
79 return result;
80}
81
86template <typename T, typename OutputIterator>
87void find_free_variables(const T& x, OutputIterator o)
88{
89 data::detail::make_find_free_variables_traverser<pbes_system::data_expression_traverser, pbes_system::add_data_variable_traverser_binding>(o).apply(x);
90}
91
97template <typename T, typename OutputIterator, typename VariableContainer>
98void find_free_variables_with_bound(const T& x, OutputIterator o, const VariableContainer& bound)
99{
100 data::detail::make_find_free_variables_traverser<pbes_system::data_expression_traverser, pbes_system::add_data_variable_traverser_binding>(o, bound).apply(x);
101}
102
106template <typename T>
107std::set<data::variable> find_free_variables(const T& x)
108{
109 std::set<data::variable> result;
110 pbes_system::find_free_variables(x, std::inserter(result, result.end()));
111 return result;
112}
113
118template <typename T, typename VariableContainer>
119std::set<data::variable> find_free_variables_with_bound(const T& x, VariableContainer const& bound)
120{
121 std::set<data::variable> result;
122 pbes_system::find_free_variables_with_bound(x, std::inserter(result, result.end()), bound);
123 return result;
124}
125
130template <typename T, typename OutputIterator>
131void find_identifiers(const T& x, OutputIterator o)
132{
133 data::detail::make_find_identifiers_traverser<pbes_system::identifier_string_traverser>(o).apply(x);
134}
135
139template <typename T>
140std::set<core::identifier_string> find_identifiers(const T& x)
141{
142 std::set<core::identifier_string> result;
143 pbes_system::find_identifiers(x, std::inserter(result, result.end()));
144 return result;
145}
146
151template <typename T, typename OutputIterator>
152void find_sort_expressions(const T& x, OutputIterator o)
153{
154 data::detail::make_find_sort_expressions_traverser<pbes_system::sort_expression_traverser>(o).apply(x);
155}
156
160template <typename T>
161std::set<data::sort_expression> find_sort_expressions(const T& x)
162{
163 std::set<data::sort_expression> result;
164 pbes_system::find_sort_expressions(x, std::inserter(result, result.end()));
165 return result;
166}
167
172template <typename T, typename OutputIterator>
173void find_function_symbols(const T& x, OutputIterator o)
174{
175 data::detail::make_find_function_symbols_traverser<pbes_system::data_expression_traverser>(o).apply(x);
176}
177
181template <typename T>
182std::set<data::function_symbol> find_function_symbols(const T& x)
183{
184 std::set<data::function_symbol> result;
185 pbes_system::find_function_symbols(x, std::inserter(result, result.end()));
186 return result;
187}
188//--- end generated pbes_system find code ---//
189
195template <typename Container, typename OutputIterator>
196void find_propositional_variable_instantiations(Container const& container, OutputIterator o)
197{
198 pbes_system::detail::make_find_propositional_variables_traverser<pbes_system::pbes_expression_traverser>(o).apply(container);
199}
200
204template <typename Container>
205std::set<propositional_variable_instantiation> find_propositional_variable_instantiations(Container const& container)
206{
207 std::set<propositional_variable_instantiation> result;
208 pbes_system::find_propositional_variable_instantiations(container, std::inserter(result, result.end()));
209 return result;
210}
211
216template <typename T>
217bool search_variable(const T& x, const data::variable& v)
218{
219 data::detail::search_variable_traverser<pbes_system::variable_traverser> f(v);
220 f.apply(x);
221 return f.found;
222}
223
224} // namespace pbes_system
225
226} // namespace mcrl2
227
228#endif // MCRL2_PBES_FIND_H
\brief A data variable
Definition variable.h:28
\brief A propositional variable instantiation
find_propositional_variables_traverser< Traverser, OutputIterator > make_find_propositional_variables_traverser(OutputIterator out)
Definition find.h:53
void find_identifiers(const T &x, OutputIterator o)
Definition find.h:131
void find_free_variables(const T &x, OutputIterator o)
Definition find.h:87
void find_function_symbols(const T &x, OutputIterator o)
Definition find.h:173
void find_sort_expressions(const T &x, OutputIterator o)
Definition find.h:152
bool search_variable(const T &x, const data::variable &v)
Returns true if the term has a given variable as subterm.
Definition find.h:217
void find_all_variables(const T &x, OutputIterator o)
Definition find.h:66
void find_propositional_variable_instantiations(Container const &container, OutputIterator o)
Returns all data variables that occur in a range of expressions.
Definition find.h:196
void find_free_variables_with_bound(const T &x, OutputIterator o, const VariableContainer &bound)
Definition find.h:98
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
add your file description here.
add your file description here.
Traverser< find_propositional_variables_traverser< Traverser, OutputIterator > > super
Definition find.h:30
void apply(const propositional_variable_instantiation &v)
Definition find.h:45