12#ifndef MCRL2_ATERMPP_DETAIL_ALGORITHM_IMPL_H
13#define MCRL2_ATERMPP_DETAIL_ALGORITHM_IMPL_H
26template <
typename Function>
35template <
class Iterator>
38 typedef typename std::iterator_traits<Iterator>::value_type
type;
41template <
class Container>
44 typedef typename Container::value_type
type;
47template <
class Container>
50 typedef typename Container::value_type
type;
53template <
class Container>
56 typedef typename Container::value_type
type;
74template <
typename UnaryFunction>
79 const aterm_list& l = down_cast<aterm_list>(t);
80 for (
const aterm& x: l)
89 for (
const aterm& x: t)
104template <
typename MatchPredicate>
114 for (
const aterm& x: t)
122 const aterm_list& l = down_cast<aterm_list>(t);
123 for (
const aterm& x: l)
138template <
typename MatchPredicate,
typename OutputIterator>
145 const aterm_list& l = down_cast<aterm_list>(t);
146 for (
const aterm& x: l)
148 find_all_if_impl<MatchPredicate>(x, op, destBegin);
155 *destBegin++ = vertical_cast<value_type>(t);
157 for (
const aterm& x: t)
159 find_all_if_impl<MatchPredicate>(x, op, destBegin);
174template <
typename MatchPredicate,
typename StopPredicate>
187 for (
const aterm& x: t)
189 aterm result = partial_find_if_impl<MatchPredicate, StopPredicate>(x, match, stop);
190 if (result !=
aterm())
199 const aterm_list& l = down_cast<aterm_list>(t);
200 for (
const aterm& x: l)
202 aterm result = partial_find_if_impl<MatchPredicate, StopPredicate>(x, match, stop);
203 if (result !=
aterm())
217template <
typename MatchPredicate,
typename StopPredicate,
typename OutputIterator>
230 for (
const aterm& x: t)
232 partial_find_all_if_impl<MatchPredicate, StopPredicate>(x, match, stop, destBegin);
238 const aterm_list& l = down_cast<aterm_list>(t);
239 for (
const aterm& x: l)
241 partial_find_all_if_impl<MatchPredicate, StopPredicate>(x, match, stop, destBegin);
const_iterator end() const
Returns a const_iterator pointing past the last argument.
const_iterator begin() const
Returns an iterator pointing to the first argument.
const function_symbol & function() const
Returns the function symbol belonging to an aterm.
bool type_is_list() const noexcept
Dynamic check whether the term is an aterm_list.
bool type_is_appl() const noexcept
Dynamic check whether the term is an aterm.
void partial_find_all_if_impl(const aterm &t, MatchPredicate match, StopPredicate stop, OutputIterator &destBegin)
Implements the partial_find_all_if algorithm.
bool find_if_impl(const aterm &t, MatchPredicate match, aterm &output)
Implements the find_if algorithm If the term t is found, it is stored in output and true is returned.
void find_all_if_impl(const aterm &t, MatchPredicate op, OutputIterator &destBegin)
Implements the find_all_if algorithm.
aterm appl_apply(const aterm &a, const Function f)
Applies the function f to all children of a.
UnaryFunction for_each_impl(aterm t, UnaryFunction op)
Implements the for_each algorithm.
aterm partial_find_if_impl(const aterm &t, MatchPredicate match, StopPredicate stop)
Implements the partial_find_if_impl algorithm.
The main namespace for the aterm++ library.
found_term_exception(const aterm &t_)
Container::value_type type
Container::value_type type
Container::value_type type
std::iterator_traits< Iterator >::value_type type