12#ifndef MCRL2_ATERMPP_ATERM_APPL_H
13#define MCRL2_ATERMPP_ATERM_APPL_H
15#include "mcrl2/atermpp/aterm_core.h"
16#include "mcrl2/atermpp/concepts.h"
17#include "mcrl2/atermpp/detail/aterm_appl_iterator.h"
18#include "mcrl2/atermpp/detail/aterm_core.h"
19#include "mcrl2/atermpp/detail/aterm_list.h"
20#include "mcrl2/atermpp/detail/global_aterm_pool.h"
21#include "mcrl2/utilities/type_traits.h"
33 explicit aterm(detail::_term_appl* t)
42 using difference_type = ptrdiff_t;
69 template <
class ForwardIterator>
70 aterm(
const function_symbol& sym, ForwardIterator begin, ForwardIterator end)
75 detail::g_thread_term_pool().create_appl_dynamic(*
this, sym, begin, end);
85 template <
class InputIterator>
86 aterm(
const function_symbol& sym, InputIterator begin, InputIterator end)
92 "The InputIterator is missing the input iterator tag.");
109 "The InputIterator has the output iterator tag.");
119 template <
typename...
Terms>
165using term_callback =
void (*)(
const aterm&);
179 class ForwardIterator>
180void make_term_appl(Term& target,
const function_symbol& sym, ForwardIterator begin, ForwardIterator end)
185 detail::g_thread_term_pool().create_appl_dynamic(target, sym, begin, end);
187 static_assert((std::is_base_of_v<aterm, Term>),
"Term must be derived from an aterm");
188 static_assert(
sizeof(Term) ==
sizeof(std::size_t),
"Term derived from an aterm must not have extra fields");
199template <
class Term,
class InputIterator>
200void make_term_appl(Term& target,
const function_symbol& sym, InputIterator begin, InputIterator end)
207 static_assert(
sizeof(
Term) ==
sizeof(
std::
size_t),
"Term derived from an aterm must not have extra fields");
209 "The InputIterator is missing the input iterator tag.");
233 static_assert(
sizeof(
Term) ==
sizeof(
std::
size_t),
"Term derived from an aterm must not have extra fields");
245 static_assert(
sizeof(
Term) ==
sizeof(
std::
size_t),
"Term derived from an aterm must not have extra fields");
331 std::ostringstream oss;
351inline void swap(atermpp::unprotected_aterm_core& t1, atermpp::unprotected_aterm_core& t2)
noexcept
atermpp::aterm create_nested_function(const std::string &function_name, const std::string &leaf_name, std::size_t number_of_arguments, std::size_t depth)
Create a nested function application f_depth. Where f_0 = c and f_i = f(f_i-1,...,...
atermpp::aterm create_nested_function(const std::string &function_name, const std::string &leaf_name, std::size_t depth)
Create a nested function application f_depth. Where f_0 = c and f_i = f(f_i-1,...,...
void benchmark_threads(std::size_t number_of_threads, F f)
Run the given function f on number_of_threads threads (including the main thread) and report the elap...
aterm(aterm &&other) noexcept=default
aterm()
Default constructor.
aterm & operator=(const aterm &other) noexcept=default
aterm(const aterm &other) noexcept=default
This class has user-declared copy constructor so declare default copy and move operators.
aterm(detail::_term_appl *t)
Constructor.
aterm & operator=(aterm &&other) noexcept=default
aterm(const function_symbol &sym, ForwardIterator begin, ForwardIterator end)
Constructor that provides an aterm based on a function symbol and forward iterator providing the argu...
void enable_garbage_collection(bool enable)
Enable garbage collection when passing true and disable otherwise.
A unordered_map class in which aterms can be stored.
Implements a simple stopwatch that starts on construction.
The main namespace for the aterm++ library.
std::string pp(const atermpp::aterm &t)
Transform an aterm to an ascii string.
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 archite...
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 a...
void swap(atermpp::aterm &t1, atermpp::aterm &t2) noexcept
Swaps two term_applss.
void swap(atermpp::unprotected_aterm_core &t1, atermpp::unprotected_aterm_core &t2) noexcept
Swaps two aterms.
int main(int argc, char *argv[])
std::size_t operator()(const atermpp::aterm &t) const