mCRL2
Loading...
Searching...
No Matches
algorithm.h File Reference

Algorithms for ATerms. More...

Go to the source code of this file.

Classes

struct  atermpp::detail::replace_aterm_builder< Builder, ReplaceFunction >
 
struct  atermpp::detail::partial_replace_aterm_builder< Builder, ReplaceFunction >
 
struct  atermpp::detail::bottom_up_replace_aterm_builder< Builder, ReplaceFunction >
 
struct  atermpp::detail::cached_bottom_up_replace_aterm_builder< Builder, ReplaceFunction >
 

Namespaces

namespace  atermpp
 The main namespace for the aterm++ library.
 
namespace  atermpp::detail
 

Functions

template<template< class > class Builder, class ReplaceFunction >
replace_aterm_builder< Builder, ReplaceFunction > atermpp::detail::make_replace_aterm_builder (ReplaceFunction f)
 
template<template< class > class Builder, class ReplaceFunction >
partial_replace_aterm_builder< Builder, ReplaceFunction > atermpp::detail::make_partial_replace_aterm_builder (ReplaceFunction f)
 
template<template< class > class Builder, class ReplaceFunction >
bottom_up_replace_aterm_builder< Builder, ReplaceFunction > atermpp::detail::make_bottom_up_replace_aterm_builder (ReplaceFunction f)
 
template<template< class > class Builder, class ReplaceFunction >
cached_bottom_up_replace_aterm_builder< Builder, ReplaceFunction > atermpp::detail::make_cached_bottom_up_replace_aterm_builder (ReplaceFunction f, std::unordered_map< aterm, aterm > &cache)
 
template<typename UnaryFunction , typename Term >
UnaryFunction atermpp::for_each (Term t, UnaryFunction op)
 Calls op(elem) for subterms of the term t.
 
template<typename Term , typename MatchPredicate >
aterm atermpp::find_if (const Term &t, MatchPredicate match)
 Finds a subterm of t that matches a given predicate.
 
template<typename Term , typename MatchPredicate , typename StopPredicate >
aterm atermpp::partial_find_if (Term t, MatchPredicate match, StopPredicate stop)
 Finds a subterm of t that matches a given predicate. The term is only partially traversed. If the stop predicate returns true in a subterm, the recursion is not continued.
 
template<typename Term , typename MatchPredicate , typename OutputIterator >
void atermpp::find_all_if (const Term &t, MatchPredicate match, OutputIterator destBegin)
 Finds all subterms of t that match a given predicate, and writes the found terms to the destination range starting with destBegin.
 
template<typename Term , typename MatchPredicate , typename StopPredicate , typename OutputIterator >
void atermpp::partial_find_all_if (Term t, MatchPredicate match, StopPredicate stop, OutputIterator destBegin)
 Finds all subterms of t that match a given predicate, and writes the found terms to the destination range starting with destBegin. The term is only partially traversed. If the stop predicate returns true in a subterm, the recursion is not continued.
 
template<typename Term , typename ReplaceFunction >
Term atermpp::replace (const Term &t, ReplaceFunction r)
 Replaces each subterm x of t by r(x). The ReplaceFunction r has the following signature: aterm x; aterm result = r(x); The replacements are performed in top down order.
 
template<typename Term >
Term atermpp::replace (const Term &t, const aterm &old_value, const aterm &new_value)
 Replaces each subterm in t that is equal to old_value with new_value. The replacements are performed in top down order. For example, replace(f(f(x)), f(x), x) returns f(x) and not x.
 
template<typename Term , typename ReplaceFunction >
Term atermpp::bottom_up_replace (Term t, ReplaceFunction r)
 Replaces each subterm x of t by r(x). The ReplaceFunction r has the following signature: aterm x; aterm result = r(x); The replacements are performed in bottom up order. For example, replace(f(f(x)), f(x), x) returns x.
 
template<typename Term >
Term atermpp::bottom_up_replace (Term t, const aterm &old_value, const aterm &new_value)
 Replaces each subterm in t that is equal to old_value with new_value. The replacements are performed in top down order. For example, replace(f(f(x)), f(x), x) returns f(x) and not x.
 
template<typename Term , typename ReplaceFunction >
Term atermpp::partial_replace (Term t, ReplaceFunction r)
 Replaces subterms x of t by r(x). The replace function r returns an additional boolean value. This value is used to prevent further recursion. The ReplaceFunction r has the following signature: aterm x; std::pair<aterm, bool> result = r(x); result.first is the result r(x) of the replacement result.second denotes if the recursion should be continued The replacements are performed in top down order.
 
template<typename Term , typename ReplaceFunction >
Term atermpp::bottom_up_replace (Term t, ReplaceFunction r, std::unordered_map< aterm, aterm > &cache)
 Replaces each subterm x of t by r(x). The ReplaceFunction r has the following signature: aterm x; aterm result = r(x); The replacements are performed in bottom up order. For example, replace(f(f(x)), f(x), x) returns x.
 

Detailed Description

Algorithms for ATerms.

Definition in file algorithm.h.