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

#include <smt_tuple_node.h>

Inheritance diagram for smt_tuple_node_flattener:
[legend]

Public Member Functions

 smt_tuple_node_flattener (smt_solver_baset *_ctx, const namespacet &_ns)
virtual ~smt_tuple_node_flattener ()=default
smt_sortt mk_struct_sort (const type2tc &type) override
 Create a sort representing a struct.
smt_astt tuple_create (const expr2tc &structdef) override
 Create a new tuple from a struct definition.
smt_astt tuple_fresh (smt_sortt s, std::string name="") override
 Create a fresh tuple, with freely valued fields.
smt_astt mk_tuple_symbol (const std::string &name, smt_sortt s) override
 Convert a symbol to a tuple_smt_ast.
expr2tc tuple_get (const expr2tc &expr) override
 Extract the assignment to a tuple-typed symbol from the SMT solvers model.
expr2tc tuple_get (const type2tc &type, smt_astt a) override
expr2tc tuple_get_rec (tuple_node_smt_astt tuple)
expr2tc tuple_get_array_elem (smt_astt array, uint64_t index, const type2tc &subtype) override
smt_astt mk_tuple_array_symbol (const expr2tc &expr) override
 Like mk_tuple_symbol, but for arrays.
smt_astt tuple_array_of (const expr2tc &init_value, unsigned long domain_width) override
 Create a potentially /large/ array of tuples.
smt_astt tuple_array_create (const type2tc &array_type, smt_astt *input_args, bool const_array, smt_sortt domain) override
void add_tuple_constraints_for_solving () override
void push_tuple_ctx () override
void pop_tuple_ctx () override
void note_elements_populated (tuple_node_smt_ast *tuple)
 Record that tuple had its elements installed at the current context level, having itself been created at a shallower one — so pop_tuple_ctx must clear them before the ASTs they name are destroyed.
Public Member Functions inherited from tuple_iface
virtual ~tuple_iface ()=default

Public Attributes

smt_solver_baset * ctx
const namespacet & ns
array_convt array_conv

Constructor & Destructor Documentation

◆ smt_tuple_node_flattener()

smt_tuple_node_flattener::smt_tuple_node_flattener ( smt_solver_baset * _ctx,
const namespacet & _ns )
inline

◆ ~smt_tuple_node_flattener()

virtual smt_tuple_node_flattener::~smt_tuple_node_flattener ( )
virtualdefault

Member Function Documentation

◆ add_tuple_constraints_for_solving()

void smt_tuple_node_flattener::add_tuple_constraints_for_solving ( )
overridevirtual

Reimplemented from tuple_iface.

◆ mk_struct_sort()

smt_sortt smt_tuple_node_flattener::mk_struct_sort ( const type2tc & type)
overridevirtual

Create a sort representing a struct.

i.e., a tuple. Ideally this should actually be part of the overridden tuple api, but due to history it isn't yet. If solvers don't support tuples, implement this to abort.

Parameters
typeThe struct type to create a tuple representation of.
Returns
The tuple representation of the type, wrapped in an smt_sort.

Implements tuple_iface.

◆ mk_tuple_array_symbol()

smt_astt smt_tuple_node_flattener::mk_tuple_array_symbol ( const expr2tc & expr)
overridevirtual

Like mk_tuple_symbol, but for arrays.

Implements tuple_iface.

◆ mk_tuple_symbol()

smt_astt smt_tuple_node_flattener::mk_tuple_symbol ( const std::string & name,
smt_sortt s )
overridevirtual

Convert a symbol to a tuple_smt_ast.

Implements tuple_iface.

◆ note_elements_populated()

void smt_tuple_node_flattener::note_elements_populated ( tuple_node_smt_ast * tuple)

Record that tuple had its elements installed at the current context level, having itself been created at a shallower one — so pop_tuple_ctx must clear them before the ASTs they name are destroyed.

Keying on the level the vector was installed at rather than the one its contents were allocated at is what makes the clear both safe and exact: installation never precedes allocation, pops descend, and the vector a tuple held before the install was empty.

◆ pop_tuple_ctx()

void smt_tuple_node_flattener::pop_tuple_ctx ( )
overridevirtual

Reimplemented from tuple_iface.

◆ push_tuple_ctx()

void smt_tuple_node_flattener::push_tuple_ctx ( )
overridevirtual

Reimplemented from tuple_iface.

◆ tuple_array_create()

smt_astt smt_tuple_node_flattener::tuple_array_create ( const type2tc & array_type,
smt_astt * input_args,
bool const_array,
smt_sortt domain )
overridevirtual

Implements tuple_iface.

◆ tuple_array_of()

smt_astt smt_tuple_node_flattener::tuple_array_of ( const expr2tc & init_value,
unsigned long domain_width )
overridevirtual

Create a potentially /large/ array of tuples.

This is called when we encounter an array_of operation, with a very large array size, of tuple sort.

Parameters
Expressionof tuple value to populate this array with.
domain_widthThe size of array to create, in domain bits.
Returns
An AST representing an array of the tuple value, init_value.

Implements tuple_iface.

◆ tuple_create()

smt_astt smt_tuple_node_flattener::tuple_create ( const expr2tc & structdef)
overridevirtual

Create a new tuple from a struct definition.

Parameters
structdefA constant_struct2tc, describing all the members of the tuple to create.
Returns
AST representing the created tuple

Implements tuple_iface.

◆ tuple_fresh()

smt_astt smt_tuple_node_flattener::tuple_fresh ( smt_sortt s,
std::string name = "" )
overridevirtual

Create a fresh tuple, with freely valued fields.

Parameters
sSort of the tuple to create
Returns
AST representing the created tuple

Implements tuple_iface.

◆ tuple_get() [1/2]

expr2tc smt_tuple_node_flattener::tuple_get ( const expr2tc & expr)
overridevirtual

Extract the assignment to a tuple-typed symbol from the SMT solvers model.

Implements tuple_iface.

◆ tuple_get() [2/2]

expr2tc smt_tuple_node_flattener::tuple_get ( const type2tc & type,
smt_astt a )
overridevirtual

Implements tuple_iface.

◆ tuple_get_array_elem()

expr2tc smt_tuple_node_flattener::tuple_get_array_elem ( smt_astt array,
uint64_t index,
const type2tc & subtype )
overridevirtual

Implements tuple_iface.

◆ tuple_get_rec()

expr2tc smt_tuple_node_flattener::tuple_get_rec ( tuple_node_smt_astt tuple)

Member Data Documentation

◆ array_conv

array_convt smt_tuple_node_flattener::array_conv

◆ ctx

smt_solver_baset* smt_tuple_node_flattener::ctx

◆ ns

const namespacet& smt_tuple_node_flattener::ns

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