89 void mark(std::stack<std::reference_wrapper<detail::_aterm>>& todo)
const
138 for (
const aterm& argument : transformed)
140 std::size_t index =
m_terms.index(argument);
141 assert(index <
m_terms.size());
149 bool assigned =
m_terms.insert(current.
term).second;
159 for (
const aterm& argument : transformed)
161 const aterm& term =
static_cast<const aterm&
>(argument);
169 current.
write =
true;
206 std::size_t version =
m_stream->read_bits(16);
209 throw mcrl2::runtime_error(
"The BAF version (" + std::to_string(version) +
") of the input file is incompatible with the version (" + std::to_string(
BAF_VERSION) +
210 ") of this tool. The input file must be regenerated. ");
251 std::string name =
m_stream->read_string();
252 std::size_t arity =
m_stream->read_integer();
259 std::size_t value =
m_stream->read_integer();
277 std::size_t value =
m_stream->read_integer();
284 std::vector<aterm> arguments(symbol.
arity());
285 for (std::size_t argument = 0; argument < symbol.
arity(); ++argument)
302 m_terms.emplace_back(transformed);
An integer term stores a single std::size_t value. It carries no arguments.
std::size_t value() const noexcept
Provide the value stored in an aterm.
aterm_transformer * m_transformer
const function_symbol & function() const
Returns the function symbol belonging to an aterm.
Reads terms from a stream in the steamable binary aterm format.
std::shared_ptr< mcrl2::utilities::ibitstream > m_stream
unsigned int m_function_symbol_index_width
caches the result of function_symbol_index_width().
unsigned int function_symbol_index_width()
atermpp::deque< aterm > m_terms
An index of read terms.
unsigned int term_index_width()
binary_aterm_istream(std::istream &is)
Provide the input stream from which terms are read.
unsigned int m_term_index_width
caches the result of term_index_width().
void get(aterm &t) override
Reads an aterm from this stream.
std::deque< function_symbol > m_function_symbols
An index of read function symbols.
Writes terms in a streamable binary aterm format to an output stream.
unsigned int m_term_index_width
caches the result of term_index_width().
~binary_aterm_ostream() override
std::size_t write_function_symbol(const function_symbol &symbol)
Write a function symbol to the output stream.
binary_aterm_ostream(std::ostream &os)
Provide the output stream to which the terms are written.
std::shared_ptr< mcrl2::utilities::obitstream > m_stream
unsigned int m_function_symbol_index_width
caches the result of function_symbol_index_width().
unsigned int term_index_width()
atermpp::indexed_set< aterm > m_terms
An index of already written terms.
void put(const aterm &term) override
Writes an aterm in a compact binary format where subterms are shared. The term that is written itself...
unsigned int function_symbol_index_width()
mcrl2::utilities::indexed_set< function_symbol > m_function_symbols
An index of already written function symbols.
Base class that should not be used.
std::size_t arity() const
Return the arity (number of arguments) of the function symbol (function_symbol).
const std::string & name() const
Return the name of the function_symbol.
A deque class in which aterms can be stored.
void emplace(Args &&... args)
bool type_is_int() const noexcept
Dynamic check whether the term is an aterm_int.
Standard exception class for reporting runtime errors.
The counterpart of obitstream, guarantees that the same data is read as has been written when calling...
A bitstream provides per bit writing of data to any stream (including stdout).
function_symbol g_as_int
These function symbols are used to indicate integer, list and empty list terms.
The main namespace for the aterm++ library.
void write_term_to_binary_stream(const aterm &t, std::ostream &os)
Writes term t to a stream in binary aterm format.
static constexpr std::uint16_t BAF_VERSION
The BAF_VERSION constant is the version number of the ATerms written in BAF format....
void read_term_from_binary_stream(std::istream &is, aterm &t)
Reads a term from a stream in binary aterm format.
packet_type
Each packet has a header consisting of a type.
void make_aterm_int(aterm_int &target, std::size_t value)
Constructs an integer term from a value.
static constexpr unsigned int packet_bits
The number of bits needed to store an element of packet_type.
static constexpr std::uint16_t BAF_MAGIC
The magic value for a binary aterm format stream.
void mcrl2_unused(T &&...)
Function that can be used to silence unused parameter warnings.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Keep track of whether the term can be written to the stream.
void mark(std::stack< std::reference_wrapper< detail::_aterm > > &todo) const
write_todo(const aterm &term)
detail::reference_aterm< aterm > term