ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
contextt Class Reference

#include <context.h>

Public Member Functions

 contextt ()
 ~contextt ()=default
 contextt (const contextt &obj)=delete
 contextt (contextt &&) noexcept=default
contextt & operator= (const contextt &rhs)=delete
contextt & operator= (contextt &&) noexcept=default
bool add (const symbolt &symbol)
bool move (symbolt &symbol, symbolt *&new_symbol)
bool move (symbolt &symbol)
symbolt * move_symbol_to_context (symbolt &symbol)
void clear ()
DUMP_METHOD void dump () const
void swap (contextt &other)
symbolt * find_symbol (const char *name)
symbolt * find_symbol (irep_idt name)
const symbolt * find_symbol (irep_idt name) const
void erase_symbol (irep_idt name)
irep_idt mark () const
 Id of the most-recently-added symbol, or a nil id if the table is empty.
void erase_since (irep_idt point)
 Erase every symbol added after point (in insertion order, as returned by mark()).
symbolt * reorder_symbol_to_back (irep_idt name)
 Move the symbol with id name to the end of the insertion-order view, keeping it in the table.
template<typename T>
void foreach_named_symbol_with_base (irep_idt base_name, T &&t) const
 Invoke t(id) for every symbol whose base name equals base_name, in insertion order (the former forall_symbol_base_map).
template<typename T>
void foreach_operand_in_order (T &&t) const
template<typename T>
void Foreach_operand_in_order (T &&t)
template<typename T>
void foreach_operand (T &&t) const
template<typename T>
void Foreach_operand (T &&t)
unsigned int size () const

Constructor & Destructor Documentation

◆ contextt() [1/3]

contextt::contextt ( )
inlineexplicit

◆ ~contextt()

contextt::~contextt ( )
default

◆ contextt() [2/3]

contextt::contextt ( const contextt & obj)
delete

◆ contextt() [3/3]

contextt::contextt ( contextt && )
defaultnoexcept

Member Function Documentation

◆ add()

bool contextt::add ( const symbolt & symbol)

◆ clear()

void contextt::clear ( )
inline

◆ dump()

void contextt::dump ( ) const

◆ erase_since()

void contextt::erase_since ( irep_idt point)

Erase every symbol added after point (in insertion order, as returned by mark()).

◆ erase_symbol()

void contextt::erase_symbol ( irep_idt name)

◆ find_symbol() [1/3]

symbolt * contextt::find_symbol ( const char * name)
inline

◆ find_symbol() [2/3]

symbolt * contextt::find_symbol ( irep_idt name)

◆ find_symbol() [3/3]

const symbolt * contextt::find_symbol ( irep_idt name) const

◆ foreach_named_symbol_with_base()

template<typename T>
void contextt::foreach_named_symbol_with_base ( irep_idt base_name,
T && t ) const
inline

Invoke t(id) for every symbol whose base name equals base_name, in insertion order (the former forall_symbol_base_map).

t returns a bool: false stops the scan early (the lambda equivalent of break). Implemented as a linear scan: the sole caller is the once-per-run entry-point search, so a dedicated base-name index is not worth maintaining on every insert.

◆ Foreach_operand()

template<typename T>
void contextt::Foreach_operand ( T && t)
inline

◆ foreach_operand()

template<typename T>
void contextt::foreach_operand ( T && t) const
inline

◆ Foreach_operand_in_order()

template<typename T>
void contextt::Foreach_operand_in_order ( T && t)
inline

◆ foreach_operand_in_order()

template<typename T>
void contextt::foreach_operand_in_order ( T && t) const
inline

◆ mark()

irep_idt contextt::mark ( ) const

Id of the most-recently-added symbol, or a nil id if the table is empty.

Pair with erase_since() to roll back a speculative batch of add() calls (e.g. a discarded IREP2-native goto_convert attempt, esbmc/esbmc#4715) in O(k) for k symbols undone, instead of an O(n) scan of the whole table.

◆ move() [1/2]

bool contextt::move ( symbolt & symbol)
inline

◆ move() [2/2]

bool contextt::move ( symbolt & symbol,
symbolt *& new_symbol )

◆ move_symbol_to_context()

symbolt * contextt::move_symbol_to_context ( symbolt & symbol)

◆ operator=() [1/2]

contextt & contextt::operator= ( const contextt & rhs)
delete

◆ operator=() [2/2]

contextt & contextt::operator= ( contextt && )
defaultnoexcept

◆ reorder_symbol_to_back()

symbolt * contextt::reorder_symbol_to_back ( irep_idt name)

Move the symbol with id name to the end of the insertion-order view, keeping it in the table.

The C/C++ frontends need this when a symbol's definition must sort after symbols it now depends on (a completed struct after its field types; a static member in definition rather than declaration order). O(1); replaces the former erase-and-reinsert, which copied the symbol and briefly dangled any held symbolt*. Returns the (stable) symbol, or nullptr if no such id exists.

◆ size()

unsigned int contextt::size ( ) const
inline

◆ swap()

void contextt::swap ( contextt & other)
inline

The documentation for this class was generated from the following files: