CBMC
|
#include <boolbv.h>
Classes | |
class | quantifiert |
Public Types | |
enum class | unbounded_arrayt { U_NONE , U_ALL , U_AUTO } |
![]() | |
typedef equalityt | SUB |
![]() | |
using | SUB = prop_conv_solvert |
![]() | |
typedef std::map< irep_idt, literalt > | symbolst |
typedef std::unordered_map< exprt, literalt, irep_hash > | cachet |
![]() | |
enum class | resultt { D_SATISFIABLE , D_UNSATISFIABLE , D_ERROR } |
Result of running the decision procedure. More... | |
Public Member Functions | |
boolbvt (const namespacet &_ns, propt &_prop, message_handlert &message_handler, bool get_array_constraints=false) | |
virtual const bvt & | convert_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. | |
virtual bvt | convert_bitvector (const exprt &expr) |
Converts an expression into its gate-level representation and returns a vector of literals corresponding to the outputs of the Boolean circuit. | |
exprt | get (const exprt &expr) const override |
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 . | |
exprt | handle (const exprt &) override |
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. | |
void | clear_cache () override |
void | finish_eager_conversion () override |
mp_integer | get_value (const bvt &bv) |
mp_integer | get_value (const bvt &bv, std::size_t offset, std::size_t width) |
const boolbv_mapt & | get_map () const |
virtual std::size_t | boolbv_width (const typet &type) const |
virtual endianness_mapt | endianness_map (const typet &type, bool little_endian) const |
virtual endianness_mapt | endianness_map (const typet &type) const |
![]() | |
arrayst (const namespacet &_ns, propt &_prop, message_handlert &message_handler, bool get_array_constraints=false) | |
literalt | record_array_equality (const equal_exprt &expr) |
void | record_array_index (const index_exprt &expr) |
![]() | |
equalityt (propt &_prop, message_handlert &message_handler) | |
virtual literalt | equality (const exprt &e1, const exprt &e2) |
void | finish_eager_conversion () override |
![]() | |
prop_conv_solvert (propt &_prop, message_handlert &message_handler) | |
virtual | ~prop_conv_solvert ()=default |
decision_proceduret::resultt | dec_solve (const exprt &) override |
Implementation of the decision procedure. | |
void | print_assignment (std::ostream &out) const override |
Print satisfying assignment to out . | |
std::string | decision_procedure_text () const override |
Return a textual description of the decision procedure. | |
exprt | get (const exprt &expr) const override |
Return expr with variables replaced by values from satisfying assignment if available. | |
tvt | l_get (literalt a) const override |
Return value of literal l from satisfying assignment. | |
exprt | handle (const exprt &expr) override |
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. | |
void | set_frozen (literalt) |
void | set_frozen (const bvt &) |
void | set_all_frozen () |
literalt | convert (const exprt &expr) override |
Convert a Boolean expression and return the corresponding literal. | |
bool | is_in_conflict (const exprt &expr) const override |
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'. | |
void | push () override |
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 | |
void | pop () override |
Pop whatever is on top of the stack. | |
const cachet & | get_cache () const |
const symbolst & | get_symbols () const |
void | set_time_limit_seconds (uint32_t lim) override |
Set the limit for the solver to time out in seconds. | |
std::size_t | get_number_of_solver_calls () const override |
Return the number of incremental solver calls. | |
hardness_collectort * | get_hardness_collector () |
![]() | |
virtual | ~conflict_providert ()=default |
![]() | |
virtual | ~prop_convt () |
![]() | |
virtual | ~stack_decision_proceduret ()=default |
![]() | |
void | set_to_true (const exprt &) |
For a Boolean expression expr , add the constraint 'expr'. | |
void | set_to_false (const exprt &) |
For a Boolean expression expr , add the constraint 'not expr'. | |
resultt | operator() () |
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. | |
virtual | ~decision_proceduret () |
![]() | |
virtual | ~solver_resource_limitst ()=default |
Public Attributes | |
unbounded_arrayt | unbounded_array |
![]() | |
bool | use_cache = true |
bool | equality_propagation = true |
bool | freeze_all = false |
Additional Inherited Members | |
![]() | |
static const char * | context_prefix = "prop_conv::context$" |
|
protected |
|
protected |
|
protected |
|
strong |
|
inline |
|
protectedvirtual |
Definition at line 497 of file boolbv.cpp.
Reimplemented in bv_pointers_widet.
|
protected |
Definition at line 586 of file boolbv.cpp.
Definition at line 261 of file boolbv_get.cpp.
Definition at line 268 of file boolbv_get.cpp.
|
protectedvirtual |
Reimplemented in bv_pointers_widet, and bv_pointerst.
Definition at line 52 of file boolbv_get.cpp.
Definition at line 280 of file boolbv_get.cpp.
|
inlineoverridevirtual |
Reimplemented from prop_conv_solvert.
Print that the expression of x has failed conversion, then return a vector of x's width.
Definition at line 94 of file boolbv.cpp.
Definition at line 17 of file boolbv_abs.cpp.
Definition at line 16 of file boolbv_add_sub.cpp.
Flatten array.
Loop over each element and convert them in turn, limiting each result's width to initial array bit size divided by number of elements. Return an empty vector if the width is zero or the array has no elements.
Definition at line 16 of file boolbv_array.cpp.
|
protectedvirtual |
Definition at line 267 of file boolbv.cpp.
|
protectedvirtual |
Flatten arrays constructed from a single element.
Definition at line 16 of file boolbv_array_of.cpp.
|
protectedvirtual |
Definition at line 114 of file boolbv_overflow.cpp.
|
protectedvirtual |
Definition at line 15 of file boolbv_bitreverse.cpp.
Converts an expression into its gate-level representation and returns a vector of literals corresponding to the outputs of the Boolean circuit.
expr | Expression to convert |
Reimplemented in bv_pointers_widet, and bv_pointerst.
Definition at line 108 of file boolbv.cpp.
Definition at line 13 of file boolbv_bitwise.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_bswap.cpp.
|
virtual |
Convert expression to vector of literalts, using an internal cache to speed up conversion if available.
Also assert the resultant vector is of a specific size, and freeze any elements if appropriate.
Definition at line 39 of file boolbv.cpp.
|
protectedvirtual |
Definition at line 54 of file boolbv_reduction.cpp.
|
protectedvirtual |
Flatten <, >, <= and >= expressions.
Definition at line 18 of file boolbv_bv_rel.cpp.
|
protectedvirtual |
Definition at line 19 of file boolbv_typecast.cpp.
|
protectedvirtual |
Definition at line 33 of file boolbv_byte_extract.cpp.
|
protectedvirtual |
Definition at line 15 of file boolbv_byte_update.cpp.
Definition at line 13 of file boolbv_case.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_complex.cpp.
|
protectedvirtual |
Definition at line 48 of file boolbv_complex.cpp.
|
protectedvirtual |
Definition at line 37 of file boolbv_complex.cpp.
|
protectedvirtual |
Definition at line 14 of file boolbv_concatenation.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_cond.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_constant.cpp.
Definition at line 12 of file boolbv_constraint_select_one.cpp.
Reimplemented in bv_refinementt.
Definition at line 13 of file boolbv_div.cpp.
|
protectedvirtual |
Definition at line 38 of file boolbv_union.cpp.
|
protectedvirtual |
Definition at line 15 of file boolbv_equality.cpp.
|
protectedvirtual |
Definition at line 19 of file boolbv_extractbit.cpp.
|
protectedvirtual |
Definition at line 14 of file boolbv_extractbits.cpp.
|
protectedvirtual |
Definition at line 15 of file boolbv_floatbv_mod_rem.cpp.
|
protectedvirtual |
Reimplemented in bv_refinementt.
Definition at line 101 of file boolbv_floatbv_op.cpp.
|
protectedvirtual |
Definition at line 83 of file boolbv_floatbv_op.cpp.
|
protectedvirtual |
Definition at line 17 of file boolbv_floatbv_op.cpp.
|
protectedvirtual |
Definition at line 326 of file boolbv.cpp.
|
protectedvirtual |
Definition at line 17 of file boolbv_ieee_float_rel.cpp.
Definition at line 12 of file boolbv_if.cpp.
|
protectedvirtual |
index operator with constant index
Definition at line 281 of file boolbv_index.cpp.
|
protectedvirtual |
Definition at line 21 of file boolbv_index.cpp.
Definition at line 15 of file boolbv_let.cpp.
|
protectedvirtual |
Definition at line 49 of file boolbv_member.cpp.
Reimplemented in bv_refinementt.
Definition at line 12 of file boolbv_mod.cpp.
|
protectedvirtual |
Reimplemented in bv_refinementt.
Definition at line 13 of file boolbv_mult.cpp.
Definition at line 13 of file boolbv_not.cpp.
|
protectedvirtual |
Definition at line 12 of file boolbv_onehot.cpp.
|
protectedvirtual |
Definition at line 192 of file boolbv_overflow.cpp.
|
protectedvirtual |
Definition at line 12 of file boolbv_power.cpp.
|
protectedvirtual |
Definition at line 261 of file boolbv_quantifier.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_reduction.cpp.
|
protectedvirtual |
Definition at line 14 of file boolbv_replication.cpp.
Reimplemented from prop_conv_solvert.
Reimplemented in bv_pointers_widet, and bv_pointerst.
Definition at line 337 of file boolbv.cpp.
|
protectedvirtual |
Definition at line 151 of file boolbv_add_sub.cpp.
|
protectedvirtual |
Definition at line 15 of file boolbv_shift.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_struct.cpp.
Definition at line 302 of file boolbv.cpp.
|
protectedvirtual |
conversion from bitvector types to boolean
Definition at line 617 of file boolbv_typecast.cpp.
|
protectedvirtual |
Definition at line 20 of file boolbv_unary_minus.cpp.
|
protectedvirtual |
Definition at line 178 of file boolbv_overflow.cpp.
|
protectedvirtual |
Definition at line 11 of file boolbv_union.cpp.
|
protectedvirtual |
Definition at line 15 of file boolbv_update.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_update_bit.cpp.
|
protectedvirtual |
Definition at line 13 of file boolbv_update_bits.cpp.
|
protected |
Definition at line 33 of file boolbv_update.cpp.
|
protectedvirtual |
Definition at line 59 of file boolbv_equality.cpp.
|
protected |
Definition at line 83 of file boolbv_with.cpp.
|
protectedvirtual |
Definition at line 17 of file boolbv_with.cpp.
|
protected |
Definition at line 128 of file boolbv_with.cpp.
|
protected |
|
protected |
Definition at line 192 of file boolbv_with.cpp.
|
protected |
Definition at line 239 of file boolbv_with.cpp.
|
virtual |
Definition at line 29 of file boolbv.cpp.
|
inlinevirtual |
Reimplemented in bv_pointerst, and bv_pointers_widet.
|
inlineoverridevirtual |
Reimplemented from arrayst.
Reimplemented in bv_pointers_widet, and bv_pointerst.
|
protected |
Definition at line 286 of file boolbv_quantifier.cpp.
|
protected |
create new, unique variables for the given binding
Definition at line 557 of file boolbv.cpp.
Return expr
with variables replaced by values from satisfying assignment if available.
Return nil
if not available
Implements decision_proceduret.
Reimplemented in string_refinementt.
Definition at line 21 of file boolbv_get.cpp.
|
inline |
|
inline |
mp_integer boolbvt::get_value | ( | const bvt & | bv, |
std::size_t | offset, | ||
std::size_t | width | ||
) |
Definition at line 376 of file boolbv_get.cpp.
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.
The returned expression may be the expression itself or a more compact but solver-specific representation.
Implements decision_proceduret.
Definition at line 83 of file boolbv.cpp.
Implements arrayst.
Definition at line 538 of file boolbv.cpp.
|
overridevirtual |
Print satisfying assignment to out
.
Implements decision_proceduret.
Definition at line 580 of file boolbv.cpp.
For a Boolean expression expr
, add the constraint 'expr' if value
is true
, otherwise add 'not expr'.
Implements decision_proceduret.
Reimplemented in string_refinementt.
Definition at line 528 of file boolbv.cpp.
|
protected |
Definition at line 32 of file boolbv_typecast.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
unbounded_arrayt boolbvt::unbounded_array |