|
mCRL2
|
The main namespace for the aterm++ library. More...
Namespaces | |
| namespace | anonymous_namespace{aterm_balanced_tree.h} |
| namespace | detail |
| namespace | utilities |
Classes | |
| class | aterm |
| class | aterm_core |
| The aterm_core base class that provides protection of the underlying shared terms. More... | |
| class | aterm_int |
| An integer term stores a single std::size_t value. It carries no arguments. More... | |
| class | aterm_istream |
| The interface for a class that reads aterm from a stream. The default constructed term aterm() indicates the end of the stream. More... | |
| class | aterm_ostream |
| The interface for a class that writes aterm to a stream. Every written term is retrieved by the corresponding aterm_istream::get() call. More... | |
| class | aterm_stream |
| The general aterm stream interface, which enables the use of a transformer to change the written/read terms. More... | |
| class | aterm_stream_state |
| A helper class to restore the state of the aterm_{i,o}stream objects upon destruction. Currently, only preserves the transformer object. More... | |
| class | aterm_string |
| Term containing a string. More... | |
| class | binary_aterm_istream |
| Reads terms from a stream in the steamable binary aterm format. More... | |
| class | binary_aterm_ostream |
| Writes terms in a streamable binary aterm format to an output stream. More... | |
| struct | builder |
| class | deque |
| A deque class in which aterms can be stored. More... | |
| struct | disable_if_container |
| struct | disable_if_container< T, V > |
| struct | enable_if_container |
| struct | enable_if_container< T, V > |
| class | function_symbol |
| class | function_symbol_generator |
| Generates unique function symbols with a given prefix. More... | |
| class | global_function_symbol |
| class | indexed_set |
| A set that assigns each element an unique index, and protects its internal terms en masse. More... | |
| struct | is_container |
| struct | is_container< T, void > |
| struct | is_set |
| class | reverse_term_list_iterator |
| Reverse iterator for term_list. More... | |
| class | stack |
| A stack class in which aterms can be stored. More... | |
| class | term_appl_iterator |
| Iterator for term_appl. More... | |
| class | term_balanced_tree |
| Read-only balanced binary tree of terms. More... | |
| class | term_list |
| A list of aterm objects. More... | |
| class | term_list_iterator |
| Iterator for term_list. More... | |
| class | text_aterm_istream |
| Reads terms in textual format from an input stream. More... | |
| class | text_aterm_ostream |
| Writes terms in textual format to an output stream. More... | |
| struct | unary_template_swap |
| class | unordered_map |
| A unordered_map class in which aterms can be stored. More... | |
| class | unordered_set |
| An unordered_set class in which aterms can be stored. More... | |
| class | unprotected_aterm_core |
| An unprotected term does not change the reference count of the shared term when it is copied or moved. More... | |
| class | vector |
| A vector class in which aterms can be stored. More... | |
| struct | write_todo |
| Keep track of whether the term can be written to the stream. More... | |
Concepts | |
| concept | IsATerm |
| Concept that can be used to indicate that T is of an ATerm type. | |
| concept | IsTermConverter |
| Concept that can be used to indicate that T is a function that can convert an aterm to another aterm. | |
Typedefs | |
| using | aterm_transformer = aterm(const aterm &) |
| A function that is applied to all terms. The resulting term should only use a subset of the original arguments (i.e. not introduce new terms). | |
| using | aterm_list = term_list< aterm > |
| A term_list with elements of type aterm. | |
| using | term_callback = void(*)(const aterm &) |
| using | term_mark_stack = std::stack< std::reference_wrapper< detail::_aterm > > |
| using | aterm_balanced_tree = term_balanced_tree< aterm > |
| A term_balanced_tree with elements of type aterm. | |
Enumerations | |
| enum class | packet_type { function_symbol = 0 , aterm , aterm_output , aterm_int_output , function_symbol = 0 , aterm , aterm_output , aterm_int_output } |
| Each packet has a header consisting of a type. More... | |
| enum class | packet_type { function_symbol = 0 , aterm , aterm_output , aterm_int_output , function_symbol = 0 , aterm , aterm_output , aterm_int_output } |
| Each packet has a header consisting of a type. More... | |
Functions | |
| aterm | identity (const aterm &x) |
| The default transformer that maps each term to itself. | |
| aterm_istream & | operator>> (aterm_istream &stream, aterm_transformer transformer) |
| Sets the given transformer to be applied to following reads. | |
| aterm_ostream & | operator<< (aterm_ostream &stream, aterm_transformer transformer) |
| aterm_ostream & | operator<< (aterm_ostream &stream, const aterm &term) |
| Write the given term to the stream. | |
| aterm_istream & | operator>> (aterm_istream &stream, aterm &term) |
| Read the given term from the stream, but for aterm_list we want to use a specific one that performs validation (defined below). | |
| template<typename T > requires std::ranges::range<T> && (!IsATerm<T>) | |
| aterm_ostream & | operator<< (aterm_ostream &stream, const T &container) |
| Write any container (that is not an aterm itself) to the stream. | |
| template<typename T > requires std::ranges::range<T> && (!IsATerm<T>) | |
| aterm_istream & | operator>> (aterm_istream &stream, T &container) |
| Read any container (that is not an aterm itself) from the stream. | |
| template<typename T > | |
| aterm_ostream && | operator<< (aterm_ostream &&stream, const T &t) |
| template<typename T > | |
| aterm_istream && | operator>> (aterm_istream &&stream, T &t) |
| std::ostream & | operator<< (std::ostream &out, const function_symbol &f) |
| Sends the name of a function symbol to an ostream. | |
| const std::string & | pp (const function_symbol &f) |
| Prints the name of a function symbol as a string. | |
| void | write_term_to_binary_stream (const aterm &t, std::ostream &os) |
| Writes term t to a stream in binary aterm format. | |
| void | read_term_from_binary_stream (std::istream &is, aterm &t) |
| Reads a term from a stream in binary aterm format. | |
| void | write_term_to_text_stream (const aterm &t, std::ostream &os) |
| Writes term t to a stream in textual format. | |
| void | read_term_from_text_stream (std::istream &is, aterm &t) |
| Reads a term from a stream which contains the term in textual format. | |
| aterm | read_term_from_string (const std::string &s) |
| Reads an aterm from a string. The string can be in either binary or text format. | |
| aterm_list | read_list_from_string (const std::string &s) |
| Reads an aterm_list from a string. The string can be in either binary or text format. | |
| aterm_int | read_int_from_string (const std::string &s) |
| Reads an aterm_int from a string. The string can be in either binary or text format. | |
| aterm | read_appl_from_string (const std::string &s) |
| Reads an aterm from a string. The string can be in either binary or text format. | |
| static void | write_string_with_escape_symbols (const std::string &s, std::ostream &os) |
| std::ostream & | operator<< (std::ostream &out, const atermpp::aterm &t) |
| Send the term in textual form to the ostream. | |
| template<typename UnaryFunction , typename Term > | |
| UnaryFunction | for_each (Term t, UnaryFunction op) |
| Calls op(elem) for subterms of the term t. | |
| template<typename Term , typename MatchPredicate > | |
| aterm | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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. | |
| template<class Term > | |
| void | make_term_list (term_list< Term > &target) |
| Make an empty list and put it in target;. | |
| template<class Term , class Iter > requires std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<Iter>::iterator_category> | |
| void | make_term_list (term_list< Term > &target, Iter first, Iter last) |
| Creates a term_list with the elements from first to last. | |
| template<class Term , class Iter , class ATermConverter > requires std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<Iter>::iterator_category> | |
| void | make_term_list (term_list< Term > &target, Iter first, Iter last, const ATermConverter &convert_to_aterm) |
| Creates a term_list with the elements from first to last converting the elements before inserting. | |
| template<class Term , class Iter , class ATermConverter , class ATermFilter > requires std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<Iter>::iterator_category> | |
| void | make_term_list (term_list< Term > &target, Iter first, Iter last, const ATermConverter &convert_to_aterm, const ATermFilter &aterm_filter) |
| Creates a term_list with the elements from first to last, converting and filtering the list. | |
| template<class Term , class Iter > requires (!std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>) | |
| void | make_term_list (term_list< Term > &target, Iter first, Iter last) |
| Creates a term_list from the elements from first to last. | |
| template<class Term , class Iter , class ATermConverter > requires (!std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>) | |
| void | make_term_list (term_list< Term > &target, Iter first, Iter last, const ATermConverter &convert_to_aterm) |
| Creates a term_list from the elements from first to last converting the elements before inserting. | |
| template<class Term , class Iter , class ATermConverter , class ATermFilter > requires (!std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>) | |
| void | make_term_list (term_list< Term > &target, Iter first, Iter last, const ATermConverter &convert_to_aterm, const ATermFilter &aterm_filter) |
| Creates a term_list from the elements from first to last converting and filtering the elements before inserting. | |
| template<class Term > | |
| void | make_term_list (term_list< Term > &target, std::initializer_list< Term > init) |
| A constructor based on an initializer list. | |
| template<typename Term , typename Compare = std::less<Term>> | |
| bool | is_sorted (const term_list< Term > &l, Compare ordering=Compare{}) |
| Returns whether the given list is sorted according to the given ordering which is by default the standard ordering on Term. | |
| template<typename Term > | |
| term_list< Term > | reverse (const term_list< Term > &l) |
| Returns the list with the elements sorted according to the given ordering which is by default standard ordering on Term. | |
| template<typename Term , typename Compare = std::less<Term>> | |
| term_list< Term > | sort_list (const term_list< Term > &l, Compare ordering=Compare{}) |
| Returns the list with the elements sorted according to given ordering which is by default the ordering of addresses of terms. | |
| template<typename Term , typename Compare = std::less<Term>> | |
| term_list< Term > | insert_sorted (const Term &t, const term_list< Term > &l, Compare ordering=Compare{}) |
| Returns the list with element t inserted in l lexicographically according to the provided ordering. | |
| template<typename Term , typename Compare = std::less<Term>> | |
| term_list< Term > | merge_lists (const term_list< Term > &l1, const term_list< Term > &l2, Compare ordering=Compare{}) |
| Returns the merged list sorted according to the given ordering, which is by default the ordering of addresses of terms. | |
| template<typename Term1 , typename Term2 > | |
| std::conditional_t< std::is_convertible_v< Term2, Term1 >, term_list< Term1 >, term_list< Term2 > > | operator+ (const term_list< Term1 > &l, const term_list< Term2 > &m) |
| Returns the concatenation of two lists with convertible element types. | |
| template<typename Term > | |
| term_list< Term > | push_back (const term_list< Term > &l, const Term &el) |
| Appends a new element at the end of the list. Note that the complexity of this function is O(n), with n the number of elements in the list!!! | |
| template<typename T > | |
| std::vector< T > | as_vector (const atermpp::term_list< T > &x) |
| Converts the given term list to a vector. | |
| template<typename T > | |
| std::set< T > | as_set (const atermpp::term_list< T > &x) |
| Converts the given term list to a set. | |
| void | add_deletion_hook (const function_symbol &, term_callback) |
| Check for reasonably sized aterm (32 bits, 4 bytes) This check might break on perfectly valid architectures that have char == 2 bytes, and sizeof(header_type) == 2. | |
| template<class Term , class ForwardIterator > requires (mcrl2::utilities::is_iterator<ForwardIterator>::value && !std::is_same_v<typename ForwardIterator::iterator_category, std::input_iterator_tag> && !std::is_same_v<typename ForwardIterator::iterator_category, std::output_iterator_tag>) | |
| void | make_term_appl (Term &target, const function_symbol &sym, ForwardIterator begin, ForwardIterator end) |
| Constructor an aterm in a variable based on a function symbol and an forward iterator providing the arguments. | |
| template<class Term , class InputIterator > requires mcrl2::utilities::is_iterator<InputIterator> | |
| void | make_term_appl (Term &target, const function_symbol &sym, InputIterator begin, InputIterator end) |
| Constructor an aterm in a variable based on a function symbol and an input iterator providing the arguments. | |
| template<class Term , typename... Terms> | |
| void | make_term_appl (Term &target, const function_symbol &symbol, const Terms &... arguments) |
| Make an aterm application for n-arity function application. | |
| template<class Term , class INDEX_TYPE , typename... Terms> | |
| void | make_term_appl_with_index (aterm &target, const function_symbol &symbol, const Terms &... arguments) |
| Constructor for n-arity function application with an index. | |
| template<IsATerm Derived, IsATerm Base> requires std::is_convertible_v<std::remove_reference_t<Base>, std::remove_reference_t<Derived>> || std::is_convertible_v<std::remove_reference_t<Derived>, std::remove_reference_t<Base>> || std::is_constructible_v<std::remove_reference_t<Base>, std::remove_reference_t<Derived>> || std::is_constructible_v<std::remove_reference_t<Derived>, std::remove_reference_t<Base>> | |
| const Derived & | down_cast (const Base &t) |
| A universal cast from an aterm to another aterm that is convertible in either direction. Less strict than vertical_cast. | |
| template<IsATerm Derived, IsATerm Base> requires std::is_convertible_v<std::remove_reference_t<Base>, std::remove_reference_t<Derived>> || std::is_convertible_v<std::remove_reference_t<Derived>, std::remove_reference_t<Base>> || std::is_constructible_v<std::remove_reference_t<Base>, std::remove_reference_t<Derived>> || std::is_constructible_v<std::remove_reference_t<Derived>, std::remove_reference_t<Base>> | |
| Derived & | assign_cast (Base &t) |
| A universal cast from an aterm to another non const aterm that is convertible in either direction. The casted term is assignable. | |
| template<IsATerm Derived, IsATerm Base> requires std::is_base_of_v<std::remove_reference_t<Base>, std::remove_reference_t<Derived>> | |
| const Derived & | vertical_cast (const Base &t) |
| A cast form an aterm derived class to a class that inherits in (possibly multiple steps) from this class. | |
| std::string | pp (const atermpp::aterm &t) |
| Transform an aterm to an ascii string. | |
| void | make_aterm_int (aterm_int &target, std::size_t value) |
| Constructs an integer term from a value. | |
| void | mark_term (const aterm_core &t, term_mark_stack &todo) |
| template<typename Term > | |
| void | make_reverse (term_list< Term > &result, const term_list< Term > &l) |
| template<typename Term > | |
| term_list< Term > | remove_one_element (const term_list< Term > &list, const Term &t) |
| template<class Term , class ForwardTraversalIterator , class Transformer > | |
| void | make_term_balanced_tree (term_balanced_tree< Term > &result, ForwardTraversalIterator p, std::size_t size, Transformer transformer) |
| bool | is_aterm_balanced_tree (const aterm &t) |
| template<class Term > | |
| std::string | pp (const term_balanced_tree< Term > t) |
| const aterm_string & | empty_string () |
| Returns the empty aterm_string. | |
| static std::mutex & | function_symbol_generator_mutex () |
| static std::size_t & | generator_sequence_number () |
| template<typename Term > | |
| term_list< Term > | term_list_union (const term_list< Term > &v, const term_list< Term > &w) |
| Returns the union of v and w. | |
| template<typename Term > | |
| term_list< Term > | term_list_difference (const term_list< Term > &v, const term_list< Term > &w) |
| Returns v minus w. | |
Variables | |
| static constexpr std::uint16_t | BAF_MAGIC = 0x8baf |
| The magic value for a binary aterm format stream. | |
| static constexpr std::uint16_t | BAF_VERSION = 0x8308 |
| The BAF_VERSION constant is the version number of the ATerms written in BAF format. As of 29 August 2013 this version number is used by the mCRL2 toolset. Whenever the file format of mCRL2 files is changed, the BAF_VERSION has to be increased. | |
| static constexpr unsigned int | packet_bits = 2 |
| The number of bits needed to store an element of packet_type. | |
| constexpr std::size_t | LengthOfShortList = 10000 |
The main namespace for the aterm++ library.
| using atermpp::aterm_balanced_tree = typedef term_balanced_tree<aterm> |
A term_balanced_tree with elements of type aterm.
Definition at line 430 of file aterm_balanced_tree.h.
| typedef term_list< aterm > atermpp::aterm_list |
A term_list with elements of type aterm.
Definition at line 523 of file aterm_list.h.
| using atermpp::aterm_transformer = typedef aterm(const aterm&) |
A function that is applied to all terms. The resulting term should only use a subset of the original arguments (i.e. not introduce new terms).
Typical usage is removing the index traits from function symbols that represent operators.
Definition at line 23 of file aterm_io.h.
| typedef void(* atermpp::term_callback)(const aterm &) |
| using atermpp::term_mark_stack = typedef std::stack<std::reference_wrapper<detail::_aterm> > |
Definition at line 27 of file aterm_container.h.
|
strong |
Each packet has a header consisting of a type.
Either indicates a function symbol, a term (either shared or output) or an arbitrary integer.
| Enumerator | |
|---|---|
| function_symbol | |
| aterm | |
| aterm_output | |
| aterm_int_output | |
| function_symbol | |
| aterm | |
| aterm_output | |
| aterm_int_output | |
Definition at line 44 of file aterm_io_binary.cpp.
|
strong |
Each packet has a header consisting of a type.
Either indicates a function symbol, a term (either shared or output) or an arbitrary integer.
| Enumerator | |
|---|---|
| function_symbol | |
| aterm | |
| aterm_output | |
| aterm_int_output | |
| function_symbol | |
| aterm | |
| aterm_output | |
| aterm_int_output | |
Definition at line 44 of file aterm_io_binary.cpp.
| void atermpp::add_deletion_hook | ( | const function_symbol & | function, |
| term_callback | callback | ||
| ) |
Check for reasonably sized aterm (32 bits, 4 bytes) This check might break on perfectly valid architectures that have char == 2 bytes, and sizeof(header_type) == 2.
Definition at line 25 of file aterm_implementation.cpp.
| std::set< T > atermpp::as_set | ( | const atermpp::term_list< T > & | x | ) |
Converts the given term list to a set.
Definition at line 613 of file aterm_list.h.
| std::vector< T > atermpp::as_vector | ( | const atermpp::term_list< T > & | x | ) |
Converts the given term list to a vector.
Definition at line 606 of file aterm_list.h.
| Derived & atermpp::assign_cast | ( | Base & | t | ) |
| 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.
| t | A term |
| old_value | The value of the subterm that is replaced. |
| new_value | The value that is substituted. |
Definition at line 291 of file algorithm.h.
| 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.
| t | A term |
| r | The replace function that is applied to subterms. |
Definition at line 276 of file algorithm.h.
| 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.
| t | A term |
| r | The replace function that is applied to subterms. |
| cache | A cache for the result of aterm terms. |
Definition at line 326 of file algorithm.h.
| const Derived & atermpp::down_cast | ( | const Base & | t | ) |
|
inline |
Returns the empty aterm_string.
Definition at line 76 of file aterm_string.h.
| 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.
| t | A term |
| match | The predicate that determines if a subterm is a match |
| destBegin | The iterator range to which output is written. |
Definition at line 215 of file algorithm.h.
| aterm atermpp::find_if | ( | const Term & | t, |
| MatchPredicate | match | ||
| ) |
Finds a subterm of t that matches a given predicate.
| t | A term |
| match | The predicate that determines if a subterm is a match |
Definition at line 189 of file algorithm.h.
| UnaryFunction atermpp::for_each | ( | Term | t, |
| UnaryFunction | op | ||
| ) |
Calls op(elem) for subterms of the term t.
| t | A term |
| op | The operation that is applied to subterms |
Definition at line 179 of file algorithm.h.
|
inlinestatic |
Definition at line 21 of file function_symbol_generator.h.
|
inlinestatic |
Definition at line 27 of file function_symbol_generator.h.
The default transformer that maps each term to itself.
Definition at line 26 of file aterm_io.h.
|
inline |
Returns the list with element t inserted in l lexicographically according to the provided ordering.
| t | An element to be inserted. |
| l | A list. |
| ordering | A total orderings relation on Term, by default the ordering relation on Terms. |
This operator has linear complexity. It is assumed that the list l is ordered for it to work.
Definition at line 181 of file aterm_list_implementation.h.
|
inline |
Definition at line 432 of file aterm_balanced_tree.h.
|
inline |
Returns whether the given list is sorted according to the given ordering which is by default the standard ordering on Term.
| l | A list. |
| ordering | A total orderings relation on Term, by default the ordering relation on Terms. |
This operator has linear complexity.
Definition at line 532 of file aterm_list.h.
|
inline |
Constructs an integer term from a value.
| target | The term into which the term is constructed. |
Definition at line 64 of file aterm_int.h.
|
inline |
Definition at line 95 of file aterm_list_implementation.h.
| void atermpp::make_term_appl | ( | Term & | target, |
| const function_symbol & | sym, | ||
| ForwardIterator | begin, | ||
| ForwardIterator | end | ||
| ) |
Constructor an aterm in a variable based on a function symbol and an forward iterator providing the arguments.
The iterator range is traversed more than once. If only one traversal is required use term_appl with a TermConverter argument. But this function is substantially less efficient. The length of the iterator range must match the arity of the function symbol.
| target | The variable in which the result will be put. This variable may be used for scratch purposes. |
| sym | A function symbol. |
| begin | The start of a range of elements. |
| end | The end of a range of elements. |
| void atermpp::make_term_appl | ( | Term & | target, |
| const function_symbol & | sym, | ||
| InputIterator | begin, | ||
| InputIterator | end | ||
| ) |
Constructor an aterm in a variable based on a function symbol and an input iterator providing the arguments.
The given iterator is traversed only once. So it can be used with an input iterator. This means that the TermConverter is applied exactly once to each element. The length of the iterator range must be equal to the arity of the function symbol.
| target | The variable in which the result will be put. This variable may be used for scratch purposes. |
| sym | A function symbol. |
| begin | The start of a range of elements. |
| end | The end of a range of elements. |
Constructor an aterm in a variable based on a function symbol and an forward iterator providing the arguments.
The given iterator is traversed only once. So it can be used with an input iterator. This means that the TermConverter is applied exactly once to each element. The length of the iterator range must be equal to the arity of the function symbol.
| target | The variable in which the result will be put. This variable may be used for scratch purposes. |
| sym | A function symbol. |
| begin | The start of a range of elements. |
| end | The end of a range of elements. |
| converter | An class or lambda term containing an operator Term operator()(const Term& t) which is applied to each each element in the iterator range before it becomes an argument of this term. |
Make an term_appl consisting of a single function symbol.
| target | The variable in which the result will be put. This variable may be used for scratch purposes. |
| sym | A function symbol. |
| void atermpp::make_term_appl | ( | Term & | target, |
| const function_symbol & | symbol, | ||
| const Terms &... | arguments | ||
| ) |
| void atermpp::make_term_appl_with_index | ( | aterm & | target, |
| const function_symbol & | symbol, | ||
| const Terms &... | arguments | ||
| ) |
| void atermpp::make_term_balanced_tree | ( | term_balanced_tree< Term > & | result, |
| ForwardTraversalIterator | p, | ||
| std::size_t | size, | ||
| Transformer | transformer | ||
| ) |
Definition at line 421 of file aterm_balanced_tree.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target | ) |
Make an empty list and put it in target;.
| target | The variable to which the empty list is assigned. |
Definition at line 332 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| Iter | first, | ||
| Iter | last | ||
| ) |
Creates a term_list with the elements from first to last.
It is assumed that the range can be traversed from last to first.
| target | The variable to which the list is assigned. |
| first | The start of a range of elements. |
| last | The end of a range of elements. |
Definition at line 345 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| Iter | first, | ||
| Iter | last | ||
| ) |
Creates a term_list from the elements from first to last.
The range is traversed from first to last. This requires to copy the elements internally, which is less efficient than this function with random access iterators as arguments.
| target | The variable to which the list is assigned. |
| first | The start of a range of elements. |
| last | The end of a range of elements. |
Definition at line 407 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| Iter | first, | ||
| Iter | last, | ||
| const ATermConverter & | convert_to_aterm | ||
| ) |
Creates a term_list with the elements from first to last converting the elements before inserting.
It is assumed that the range can be traversed from last to first. The operator () in the class ATermConverter is applied to each element before inserting it in the list.
| target | The variable to which the list is assigned. |
| first | The start of a range of elements. |
| last | The end of a range of elements. |
| convert_to_aterm | A class with a () operation, which is applied to each element before it is put into the list. |
Definition at line 365 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| Iter | first, | ||
| Iter | last, | ||
| const ATermConverter & | convert_to_aterm | ||
| ) |
Creates a term_list from the elements from first to last converting the elements before inserting.
The range is traversed from first to last. This requires to copy the elements internally, which is less efficient than this function with random access iterators as arguments. The operator () in the class ATermConverter is applied to each element before inserting it in the list.
| target | The variable to which the list is assigned. |
| first | The start of a range of elements. |
| last | The end of a range of elements. |
| convert_to_aterm | A class with a () operation, which is applied to each element before it is put into the list. |
Definition at line 430 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| Iter | first, | ||
| Iter | last, | ||
| const ATermConverter & | convert_to_aterm, | ||
| const ATermFilter & | aterm_filter | ||
| ) |
Creates a term_list with the elements from first to last, converting and filtering the list.
It is assumed that the range can be traversed from last to first. The operator () in the class ATermConverter is applied to each element before inserting it in the list. Elements are only inserted if the operator () of the class ATermFilter yields true when applied to such an element.
| target | The variable to which the list is assigned. |
| first | The start of a range of elements. |
| last | The end of a range of elements. |
| convert_to_aterm | A class with a () operation, which is applied to each element before it is put into the list. |
| aterm_filter | A class with an operator () that is used to determine whether elements can be inserted in the list. |
Definition at line 387 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| Iter | first, | ||
| Iter | last, | ||
| const ATermConverter & | convert_to_aterm, | ||
| const ATermFilter & | aterm_filter | ||
| ) |
Creates a term_list from the elements from first to last converting and filtering the elements before inserting.
The range is traversed from first to last. This requires to copy the elements internally, which is less efficient than this function with random access iterators as arguments. The operator () in the class ATermConverter is applied to each element before inserting it in the list. Elements are only inserted if the operator () of the class ATermFilter yields true when applied to such an element.
| target | The variable to which the list is assigned. |
| first | The start of a range of elements. |
| last | The end of a range of elements. |
| convert_to_aterm | A class with a () operation, which is applied to each element before it is put into the list. |
| aterm_filter | A class with an operator () that is used to determine whether elements can be inserted in the list. |
Definition at line 456 of file aterm_list.h.
| void atermpp::make_term_list | ( | term_list< Term > & | target, |
| std::initializer_list< Term > | init | ||
| ) |
A constructor based on an initializer list.
This constructor is not made explicit to conform to initializer lists in standard containers.
| target | The variable to which the list is assigned. |
| init | The initialiser list. |
Definition at line 472 of file aterm_list.h.
|
inline |
Definition at line 29 of file aterm_container.h.
|
inline |
Returns the merged list sorted according to the given ordering, which is by default the ordering of addresses of terms.
| l1 | An ordered list. |
| l2 | Another ordered list. |
| ordering | A total orderings relation on Term, by default the ordering relation on Terms. |
This operator is linear in the cumulative length of l1 and l2. In debug mode it checks whether l1 and l2 are ordered.
Definition at line 262 of file aterm_list_implementation.h.
|
inline |
Returns the concatenation of two lists with convertible element types.
The type of the result is either the type of l, if the elements of m can be converted implicitly to the type of the elements of l. Otherwise if the elements of l can be converted implicitly to the type of the elements of m, the result type is that or m.
| l | A list. |
| m | A list. |
The complexity of this operator is linear in the length of l.
Definition at line 408 of file aterm_list_implementation.h.
|
inline |
Definition at line 164 of file aterm_io.h.
|
inline |
Definition at line 78 of file aterm_io.h.
|
inline |
Write the given term to the stream.
Definition at line 85 of file aterm_io.h.
|
inline |
Write any container (that is not an aterm itself) to the stream.
Definition at line 129 of file aterm_io.h.
| std::ostream & atermpp::operator<< | ( | std::ostream & | out, |
| const aterm & | term | ||
| ) |
Send the term in textual form to the ostream.
| out | The stream to which the term is sent. |
| t | The term that is printed to the stream. |
Definition at line 395 of file aterm_io_text.cpp.
|
inline |
Sends the name of a function symbol to an ostream.
| out | The out stream. |
| f | The function symbol to be output. |
Definition at line 181 of file aterm_io.h.
|
inline |
Definition at line 171 of file aterm_io.h.
|
inline |
Read the given term from the stream, but for aterm_list we want to use a specific one that performs validation (defined below).
Definition at line 93 of file aterm_io.h.
|
inline |
Sets the given transformer to be applied to following reads.
Definition at line 73 of file aterm_io.h.
|
inline |
Read any container (that is not an aterm itself) from the stream.
Definition at line 145 of file aterm_io.h.
| 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.
| t | A term |
| match | The predicate that determines if a subterm is a match |
| stop | The predicate that determines if the recursion should not be continued in a subterm |
| destBegin | The iterator range to which output is written. |
Definition at line 230 of file algorithm.h.
| 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.
| t | A term |
| match | The predicate that determines if a subterm is a match |
| stop | The predicate that determines if the recursion should not be continued in a subterm |
Definition at line 204 of file algorithm.h.
| 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.
| t | A term |
| r | The replace function that is applied to subterms. |
Definition at line 308 of file algorithm.h.
|
inline |
|
inline |
Prints the name of a function symbol as a string.
| f | The function symbol. |
Definition at line 189 of file aterm_io.h.
| std::string atermpp::pp | ( | const term_balanced_tree< Term > | t | ) |
Definition at line 440 of file aterm_balanced_tree.h.
|
inline |
Appends a new element at the end of the list. Note that the complexity of this function is O(n), with n the number of elements in the list!!!
| l | The list to which the term is appended. |
| el | A term. |
Definition at line 43 of file aterm_list_implementation.h.
|
inline |
Reads an aterm from a string. The string can be in either binary or text format.
If the input is not an aterm, an aterm is returned of the wrong type.
Definition at line 232 of file aterm_io.h.
|
inline |
Reads an aterm_int from a string. The string can be in either binary or text format.
If the input is not an int, an aterm is returned of the wrong type.
Definition at line 222 of file aterm_io.h.
|
inline |
Reads an aterm_list from a string. The string can be in either binary or text format.
If the input is not a string, an aterm is returned of the wrong type.
Definition at line 212 of file aterm_io.h.
| void atermpp::read_term_from_binary_stream | ( | std::istream & | is, |
| aterm & | t | ||
| ) |
Reads a term from a stream in binary aterm format.
Definition at line 328 of file aterm_io_binary.cpp.
| aterm atermpp::read_term_from_string | ( | const std::string & | s | ) |
Reads an aterm from a string. The string can be in either binary or text format.
Definition at line 381 of file aterm_io_text.cpp.
| void atermpp::read_term_from_text_stream | ( | std::istream & | is, |
| aterm & | t | ||
| ) |
Reads a term from a stream which contains the term in textual format.
Definition at line 389 of file aterm_io_text.cpp.
|
inline |
Definition at line 364 of file aterm_list_implementation.h.
| 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.
| t | A term |
| old_value | The subterm that will be replaced. |
| new_value | The value that will be substituted. |
Definition at line 261 of file algorithm.h.
| 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.
| t | A term |
| r | The replace function that is applied to subterms. |
Definition at line 246 of file algorithm.h.
Returns the list with the elements sorted according to the given ordering which is by default standard ordering on Term.
| l | A list. |
| ordering | A total orderings relation on Term, by default the ordering relation on Terms. |
Returns the list with the elements in reversed order.
| l | A list. |
This operator is linear in the size of the list.
Definition at line 106 of file aterm_list_implementation.h.
|
inline |
Returns the list with the elements sorted according to given ordering which is by default the ordering of addresses of terms.
| l | A list. |
| ordering | An total orderings relation on Term, by default the ordering relation on Terms. |
This operator has complexity nlog n where n is the size of the list.
Definition at line 122 of file aterm_list_implementation.h.
| term_list< Term > atermpp::term_list_difference | ( | const term_list< Term > & | v, |
| const term_list< Term > & | w | ||
| ) |
Returns v minus w.
| v | A term list. |
| w | A term list. |
Definition at line 46 of file set_operations.h.
| term_list< Term > atermpp::term_list_union | ( | const term_list< Term > & | v, |
| const term_list< Term > & | w | ||
| ) |
Returns the union of v and w.
| v | A term list. |
| w | A term list. |
Definition at line 25 of file set_operations.h.
| const Derived & atermpp::vertical_cast | ( | const Base & | t | ) |
A cast form an aterm derived class to a class that inherits in (possibly multiple steps) from this class.
The derived class is not allowed to contain extra fields. This conversion does not require runtime computation effort. Also see down_cast.
| t | The term that is converted. |
|
static |
Definition at line 19 of file aterm_io_text.cpp.
| void atermpp::write_term_to_binary_stream | ( | const aterm & | t, |
| std::ostream & | os | ||
| ) |
Writes term t to a stream in binary aterm format.
Definition at line 323 of file aterm_io_binary.cpp.
| void atermpp::write_term_to_text_stream | ( | const aterm & | t, |
| std::ostream & | os | ||
| ) |
Writes term t to a stream in textual format.
Definition at line 376 of file aterm_io_text.cpp.
|
staticconstexpr |
The magic value for a binary aterm format stream.
As of version 0x8305 the magic and version are written as 2 bytes not encoded as variable-width integers. To ensure compatibility with older formats the previously variable-width encoding is mimicked by prefixing them with 1000 (0x8).
Definition at line 21 of file aterm_io_binary.cpp.
|
staticconstexpr |
The BAF_VERSION constant is the version number of the ATerms written in BAF format. As of 29 August 2013 this version number is used by the mCRL2 toolset. Whenever the file format of mCRL2 files is changed, the BAF_VERSION has to be increased.
History:
before 2013 : version 0x0300 29 August 2013 : version changed to 0x0301 23 November 2013 : version changed to 0x0302 (introduction of index for variable types) 24 September 2014 : version changed to 0x0303 (introduction of stochastic distribution) 2 April 2017 : version changed to 0x0304 (removed a few superfluous fields in the format) 19 July 2019 : version changed to 0x8305 (introduction of the streamable aterm format) 28 February 2020 : version changed to 0x8306 (added ability to stream aterm_int, implemented structured streaming for all objects) 24 January 2023 : version changed to 0x8307 (removed NoIndex from Variables, Boolean variables. Made the .lts format more compact by not storing states with a default probability 1) 6 August 2024 : version changed to 0x8308 (introduced machine numbers)
Definition at line 40 of file aterm_io_binary.cpp.
|
constexpr |
Definition at line 23 of file aterm_list_implementation.h.
|
staticconstexpr |
The number of bits needed to store an element of packet_type.
Definition at line 53 of file aterm_io_binary.cpp.