CBMC
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
bv_refinementt Class Reference

#include <bv_refinement.h>

+ Inheritance diagram for bv_refinementt:
+ Collaboration diagram for bv_refinementt:

Classes

struct   approximationt
 
struct   configt
 
struct   infot
 

Public Member Functions

 
  Implementation of the decision procedure.
 
  Return a textual description of the decision procedure.
 
- Public Member Functions inherited from bv_pointerst
 
 
 
- 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 Member Functions

  generate array constraints
 
 
 
 
 
- Protected Member Functions inherited from bv_pointerst
 
 
 
 
 
 
 
  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.
 
 
 
 
 

Protected Attributes

 
- Protected Attributes inherited from bv_pointerst
 
 
- 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
 

Private Member Functions

 
 
  check if an under-approximation is part of the conflict
 
  inspect if satisfying assignment extends to original formula, otherwise refine overapproximation
 
  inspect if proof holds on original formula, otherwise refine underapproximation
 
 
 
 
 
  check whether counterexample is spurious
 
  freeze symbols for incremental solving
 

Private Attributes

 
 

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
 
 
 
- Protected Types inherited from bv_pointerst
 
 
- 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
 
- Static Protected Member Functions inherited from bv_pointerst
  Construct a pointer encoding from given encodings of object and offset.
 
- Static Protected Attributes inherited from prop_conv_solvert
static const charcontext_prefix = "prop_conv::context$"
 

Detailed Description

Definition at line 19 of file bv_refinement.h.

Constructor & Destructor Documentation

◆  bv_refinementt()

bv_refinementt::bv_refinementt ( const infotinfo )
explicit

Definition at line 13 of file bv_refinement_loop.cpp.

Member Function Documentation

◆  add_approximation()

bv_refinementt::approximationt & bv_refinementt::add_approximation ( const exprtexpr,
bvtbv 
)
private

Definition at line 481 of file refine_arithmetic.cpp.

◆  arrays_overapproximated()

void bv_refinementt::arrays_overapproximated ( )
private

check whether counterexample is spurious

Definition at line 36 of file refine_arrays.cpp.

◆  check_SAT() [1/2]

void bv_refinementt::check_SAT ( )
private

Definition at line 120 of file bv_refinement_loop.cpp.

◆  check_SAT() [2/2]

void bv_refinementt::check_SAT ( approximationtapproximation )
private

inspect if satisfying assignment extends to original formula, otherwise refine overapproximation

Definition at line 161 of file refine_arithmetic.cpp.

◆  check_UNSAT() [1/2]

void bv_refinementt::check_UNSAT ( )
private

Definition at line 134 of file bv_refinement_loop.cpp.

◆  check_UNSAT() [2/2]

void bv_refinementt::check_UNSAT ( approximationtapproximation )
private

inspect if proof holds on original formula, otherwise refine underapproximation

Definition at line 363 of file refine_arithmetic.cpp.

◆  conflicts_with()

bool bv_refinementt::conflicts_with ( approximationtapproximation )
private

check if an under-approximation is part of the conflict

Definition at line 451 of file refine_arithmetic.cpp.

◆  convert_div()

bvt bv_refinementt::convert_div ( const div_exprtexpr )
overrideprotectedvirtual

Reimplemented from boolbvt.

Definition at line 100 of file refine_arithmetic.cpp.

◆  convert_floatbv_op()

bvt bv_refinementt::convert_floatbv_op ( const ieee_float_op_exprtexpr )
overrideprotectedvirtual

Reimplemented from boolbvt.

Definition at line 39 of file refine_arithmetic.cpp.

◆  convert_mod()

bvt bv_refinementt::convert_mod ( const mod_exprtexpr )
overrideprotectedvirtual

Reimplemented from boolbvt.

Definition at line 118 of file refine_arithmetic.cpp.

◆  convert_mult()

bvt bv_refinementt::convert_mult ( const mult_exprtexpr )
overrideprotectedvirtual

Reimplemented from boolbvt.

Definition at line 52 of file refine_arithmetic.cpp.

◆  dec_solve()

decision_proceduret::resultt bv_refinementt::dec_solve ( const exprtassumption )
overridevirtual

Implementation of the decision procedure.

Implements decision_proceduret.

Reimplemented in string_refinementt.

Definition at line 24 of file bv_refinement_loop.cpp.

◆  decision_procedure_text()

std::string bv_refinementt::decision_procedure_text ( ) const
inlineoverridevirtual

Return a textual description of the decision procedure.

Implements decision_proceduret.

Reimplemented in string_refinementt.

Definition at line 44 of file bv_refinement.h.

◆  finish_eager_conversion_arrays()

void bv_refinementt::finish_eager_conversion_arrays ( )
overrideprotectedvirtual

generate array constraints

Reimplemented from arrayst.

Definition at line 21 of file refine_arrays.cpp.

◆  freeze_lazy_constraints()

void bv_refinementt::freeze_lazy_constraints ( )
private

freeze symbols for incremental solving

Definition at line 125 of file refine_arrays.cpp.

◆  get_values()

void bv_refinementt::get_values ( approximationtapproximation )
private

Definition at line 136 of file refine_arithmetic.cpp.

◆  initialize()

void bv_refinementt::initialize ( approximationtapproximation )
private

Definition at line 465 of file refine_arithmetic.cpp.

◆  prop_solve()

decision_proceduret::resultt bv_refinementt::prop_solve ( )
private

Definition at line 87 of file bv_refinement_loop.cpp.

Member Data Documentation

◆  approximations

std::list<approximationt> bv_refinementt::approximations
private

Definition at line 108 of file bv_refinement.h.

◆  config_

configt bv_refinementt::config_
protected

Definition at line 112 of file bv_refinement.h.

◆  progress

bool bv_refinementt::progress
private

Definition at line 107 of file bv_refinement.h.


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

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