CBMC
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
bv_pointerst Class Reference

#include <bv_pointers.h>

+ Inheritance diagram for bv_pointerst:
+ Collaboration diagram for bv_pointerst:

Classes

struct   postponedt
 

Public Member Functions

 
 
 
- Public Member Functions inherited from boolbvt
 
virtual const bvtconvert_bv (const exprt &expr, const std::optional< std::size_t > expected_width={})
  Convert expression to vector of literalts, using an internal cache to speed up conversion if available.
 
  Return expr with variables replaced by values from satisfying assignment if available.
 
void  set_to (const exprt &expr, bool value) override
  For a Boolean expression expr, add the constraint 'expr' if value is true, otherwise add 'not expr'.
 
void  print_assignment (std::ostream &out) const override
  Print satisfying assignment to out.
 
  Generate a handle, which is an expression that has the same value as the argument in any model that is generated; this offers an efficient way to refer to the expression in subsequent calls to get or set_to.
 
 
 
mp_integer  get_value (const bvt &bv, std::size_t offset, std::size_t width)
 
 
virtual std::size_t  boolbv_width (const typet &type) const
 
 
- Public Member Functions inherited from arrayst
 
 
 
  Record that symbol is equal to value for the purposes of the array theory.
 
- Public Member Functions inherited from equalityt
  equalityt (propt &_prop, message_handlert &message_handler)
 
 
 
- Public Member Functions inherited from prop_conv_solvert
 
 
  Implementation of the decision procedure.
 
void  print_assignment (std::ostream &out) const override
  Print satisfying assignment to out.
 
  Return a textual description of the decision procedure.
 
  Return expr with variables replaced by values from satisfying assignment if available.
 
  Return value of literal l from satisfying assignment.
 
  Generate a handle, which is an expression that has the same value as the argument in any model that is generated; this offers an efficient way to refer to the expression in subsequent calls to get or set_to.
 
 
 
 
  Convert a Boolean expression and return the corresponding literal.
 
  Returns true if an expression is in the final conflict leading to UNSAT.
 
void  set_to (const exprt &expr, bool value) override
  For a Boolean expression expr, add the constraint 'current_context => expr' if value is true, otherwise add 'current_context => not expr'.
 
  Push a new context on the stack This context becomes a child context nested in the current context.
 
void  push (const std::vector< exprt > &assumptions) override
  Push assumptions in form of literal_exprt
 
  Pop whatever is on top of the stack.
 
 
 
  Set the limit for the solver to time out in seconds.
 
  Return the number of incremental solver calls.
 
 
- Public Member Functions inherited from conflict_providert
 
- Public Member Functions inherited from prop_convt
 
- Public Member Functions inherited from stack_decision_proceduret
 
- Public Member Functions inherited from decision_proceduret
  For a Boolean expression expr, add the constraint 'expr'.
 
  For a Boolean expression expr, add the constraint 'not expr'.
 
  Run the decision procedure to solve the problem This corresponds to SMT-LIB's check-sat.
 
resultt  operator() (const exprt &assumption)
  Run the decision procedure to solve the problem under the given assumption.
 
 
- Public Member Functions inherited from solver_resource_limitst
 

Protected Types

 
 
- Protected Types inherited from boolbvt
 
typedef std::unordered_map< const exprt, bvt, irep_hashbv_cachet
 
 
typedef std::vector< std::size_t >  offset_mapt
 
- Protected Types inherited from arrayst
 
 
 
typedef std::set< exprtindex_sett
 
typedef std::map< std::size_t, index_settindex_mapt
 
 
- Protected Types inherited from equalityt
typedef std::unordered_map< const exprt, unsigned, irep_hashelementst
 
typedef std::map< std::pair< unsigned, unsigned >, literaltequalitiest
 
 
typedef std::unordered_map< const typet, typestructt, irep_hashtypemapt
 

Protected Member Functions

 
 
 
 
 
 
 
  Converts an expression into its gate-level representation and returns a vector of literals corresponding to the outputs of the Boolean circuit.
 
exprt  bv_get_rec (const exprt &, const bvt &, std::size_t offset) const override
 
std::optional< bvtconvert_address_of_rec (const exprt &)
 
 
 
 
 
  Create Boolean functions describing all dynamic and all not-dynamic object encodings over placeholders as input Boolean variables representing object bits.
 
std::unordered_map< exprt, exprt, irep_hashprepare_postponed_object_size (std::vector< symbol_exprt > &placeholders) const
  Create Boolean functions describing all objects of each known object size over placeholders as input Boolean variables representing object bits.
 
  Given a pointer encoded in bv, extract the literals identifying the object that the pointer points to.
 
  Given a pointer encoded in bv, extract the literals representing the offset into an object that the pointer points to.
 
- Protected Member Functions inherited from boolbvt
 
  Print that the expression of x has failed conversion, then return a vector of x's width.
 
 
  Flatten <, >, <= and >= expressions.
 
  conversion from bitvector types to boolean
 
 
 
 
 
 
 
 
 
 
  index operator with constant index
 
 
 
 
 
 
 
 
  Flatten array.
 
 
 
 
 
 
  Flatten arrays constructed from a single element.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bvt  convert_update_bits (bvt src, const exprt &index, const bvt &new_value)
 
 
 
 
 
 
void  convert_update_rec (const exprt::operandst &designator, std::size_t d, const typet &type, std::size_t offset, const exprt &new_value, bvt &bv)
 
 
exprt  bv_get (const bvt &bv, const typet &type) const
 
 
  Return the model value for expr.
 
 
 
 
  create new, unique variables for the given binding
 
- Protected Member Functions inherited from arrayst
 
  adds array constraints (refine=true...lazily for the refinement loop)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
void  update_index_map (std::size_t i)
  merge the indices into the root
 
 
 
 
- Protected Member Functions inherited from equalityt
 
 
 
- Protected Member Functions inherited from prop_conv_solvert
virtual std::optional< boolget_bool (const exprt &expr) const
  Get a boolean value from the model if the formula is satisfiable.
 
 
 
 
 

Static Protected Member Functions

  Construct a pointer encoding from given encodings of object and offset.
 

Protected Attributes

 
 
- Protected Attributes inherited from boolbvt
 
 
 
 
 
 
 
std::size_t  scope_counter = 0
 
- Protected Attributes inherited from arrayst
 
 
 
 
 
 
 
 
 
 
std::map< exprt, boolexpr_map
 
 
std::set< std::size_t >  update_indices
 
std::unordered_set< irep_idtarray_comprehension_args
 
- Protected Attributes inherited from equalityt
 
- Protected Attributes inherited from prop_conv_solvert
 
 
 
proptprop
 
 
  Assumptions on the stack.
 
std::size_t  context_literal_counter = 0
  To generate unique literal names for contexts.
 
std::vector< size_tcontext_size_stack
  assumption_stack is segmented in contexts; Number of assumptions in each context on the stack
 

Additional Inherited Members

- Public Types inherited from boolbvt
enum class   unbounded_arrayt { U_NONE , U_ALL , U_AUTO }
 
- Public Types inherited from arrayst
 
- Public Types inherited from equalityt
 
- Public Types inherited from prop_conv_solvert
 
typedef std::unordered_map< exprt, literalt, irep_hashcachet
 
- Public Types inherited from decision_proceduret
  Result of running the decision procedure. More...
 
- Public Attributes inherited from boolbvt
 
- Public Attributes inherited from prop_conv_solvert
 
 
 
- Static Protected Attributes inherited from prop_conv_solvert
static const charcontext_prefix = "prop_conv::context$"
 

Detailed Description

Definition at line 16 of file bv_pointers.h.

Member Typedef Documentation

◆  postponed_listt

Definition at line 85 of file bv_pointers.h.

◆  SUB

Definition at line 38 of file bv_pointers.h.

Constructor & Destructor Documentation

◆  bv_pointerst()

bv_pointerst::bv_pointerst ( const namespacet_ns,
propt_prop,
message_handlertmessage_handler,
bool  get_array_constraints = false  
)

Definition at line 227 of file bv_pointers.cpp.

Member Function Documentation

◆  add_addr()

bvt bv_pointerst::add_addr ( const exprtexpr )
protectedvirtual

Definition at line 879 of file bv_pointers.cpp.

◆  bv_get_rec()

exprt bv_pointerst::bv_get_rec ( const exprtexpr,
const bvtbv,
std::size_t  offset 
) const
overrideprotectedvirtual

Reimplemented from boolbvt.

Definition at line 754 of file bv_pointers.cpp.

◆  convert_address_of_rec()

std::optional< bvt > bv_pointerst::convert_address_of_rec ( const exprtexpr )
protected

Definition at line 237 of file bv_pointers.cpp.

◆  convert_bitvector()

bvt bv_pointerst::convert_bitvector ( const exprtexpr )
overrideprotectedvirtual

Converts an expression into its gate-level representation and returns a vector of literals corresponding to the outputs of the Boolean circuit.

Parameters
expr Expression to convert
Returns
A vector of literals corresponding to the outputs of the Boolean circuit

Reimplemented from boolbvt.

Definition at line 621 of file bv_pointers.cpp.

◆  convert_pointer_type()

bvt bv_pointerst::convert_pointer_type ( const exprtexpr )
protectedvirtual

Definition at line 376 of file bv_pointers.cpp.

◆  convert_rest()

literalt bv_pointerst::convert_rest ( const exprtexpr )
overrideprotectedvirtual

Reimplemented from boolbvt.

Definition at line 126 of file bv_pointers.cpp.

◆  encode()

bvt bv_pointerst::encode ( const mp_integerobject,
const pointer_typettype 
) const
protected

Definition at line 790 of file bv_pointers.cpp.

◆  endianness_map()

endianness_mapt bv_pointerst::endianness_map ( const typettype,
bool  little_endian 
) const
overridevirtual

Reimplemented from boolbvt.

Definition at line 72 of file bv_pointers.cpp.

◆  finish_eager_conversion()

void bv_pointerst::finish_eager_conversion ( )
overridevirtual

Reimplemented from boolbvt.

Definition at line 1005 of file bv_pointers.cpp.

◆  get_address_width()

std::size_t bv_pointerst::get_address_width ( const pointer_typettype ) const
protected

Definition at line 91 of file bv_pointers.cpp.

◆  get_object_width()

std::size_t bv_pointerst::get_object_width ( const pointer_typet &  ) const
protected

Definition at line 77 of file bv_pointers.cpp.

◆  get_offset_width()

std::size_t bv_pointerst::get_offset_width ( const pointer_typettype ) const
protected

Definition at line 83 of file bv_pointers.cpp.

◆  object_literals()

bvt bv_pointerst::object_literals ( const bvtbv,
const pointer_typettype 
) const
protected

Given a pointer encoded in bv, extract the literals identifying the object that the pointer points to.

Parameters
bv Encoded pointer
type Type of the encoded pointer
Returns
Vector of literals identifying the object part of bv

Definition at line 96 of file bv_pointers.cpp.

◆  object_offset_encoding()

bvt bv_pointerst::object_offset_encoding ( const bvtobject,
const bvtoffset 
)
staticprotected

Construct a pointer encoding from given encodings of object and offset.

Parameters
object Encoded object
offset Encoded offset
Returns
Pointer encoding

Definition at line 116 of file bv_pointers.cpp.

◆  offset_arithmetic() [1/4]

bvt bv_pointerst::offset_arithmetic ( const pointer_typettype,
const bvtbv,
const mp_integerx 
)
protected

Definition at line 802 of file bv_pointers.cpp.

◆  offset_arithmetic() [2/4]

bvt bv_pointerst::offset_arithmetic ( const pointer_typettype,
const bvtbv,
const mp_integerfactor,
const bvtindex_bv 
)
protected

Definition at line 853 of file bv_pointers.cpp.

◆  offset_arithmetic() [3/4]

bvt bv_pointerst::offset_arithmetic ( const pointer_typettype,
const bvtbv,
const mp_integerfactor,
const exprtindex 
)
protected

Definition at line 813 of file bv_pointers.cpp.

◆  offset_arithmetic() [4/4]

bvt bv_pointerst::offset_arithmetic ( const pointer_typettype,
const bvtbv,
const exprtfactor,
const exprtindex 
)
protected

Definition at line 831 of file bv_pointers.cpp.

◆  offset_literals()

bvt bv_pointerst::offset_literals ( const bvtbv,
const pointer_typettype 
) const
protected

Given a pointer encoded in bv, extract the literals representing the offset into an object that the pointer points to.

Parameters
bv Encoded pointer
type Type of the encoded pointer
Returns
Vector of literals identifying the offset part of bv

Definition at line 107 of file bv_pointers.cpp.

◆  prepare_postponed_is_dynamic_object()

std::pair< exprt, exprt > bv_pointerst::prepare_postponed_is_dynamic_object ( std::vector< symbol_exprt > &  placeholders ) const
protected

Create Boolean functions describing all dynamic and all not-dynamic object encodings over placeholders as input Boolean variables representing object bits.

Definition at line 897 of file bv_pointers.cpp.

◆  prepare_postponed_object_size()

std::unordered_map< exprt, exprt, irep_hash > bv_pointerst::prepare_postponed_object_size ( std::vector< symbol_exprt > &  placeholders ) const
protected

Create Boolean functions describing all objects of each known object size over placeholders as input Boolean variables representing object bits.

Definition at line 949 of file bv_pointers.cpp.

Member Data Documentation

◆  pointer_logic

pointer_logict bv_pointerst::pointer_logic
protected

Definition at line 31 of file bv_pointers.h.

◆  postponed_list

postponed_listt bv_pointerst::postponed_list
protected

Definition at line 86 of file bv_pointers.h.


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

AltStyle によって変換されたページ (->オリジナル) /