CBMC
|
#include <smt2_conv.h>
Classes | |
struct | identifiert |
class | smt2_symbolt |
Public Types | |
enum class | solvert { GENERIC , BITWUZLA , BOOLECTOR , CPROVER_SMT2 , CVC3 , CVC4 , CVC5 , MATHSAT , YICES , Z3 } |
![]() | |
enum class | resultt { D_SATISFIABLE , D_UNSATISFIABLE , D_ERROR } |
Result of running the decision procedure. More... | |
Public Member Functions | |
smt2_convt (const namespacet &_ns, const std::string &_benchmark, const std::string &_notes, const std::string &_logic, solvert _solver, std::ostream &_out) | |
~smt2_convt () override=default | |
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_to (const exprt &expr, bool value) override |
For a Boolean expression expr , add the constraint 'expr' if value is true , otherwise add 'not expr'. | |
exprt | get (const exprt &expr) const override |
Return expr with variables replaced by values from satisfying assignment if available. | |
std::string | decision_procedure_text () const override |
Return a textual description of the decision procedure. | |
void | print_assignment (std::ostream &out) const override |
Print satisfying assignment to out . | |
void | push () override |
Unimplemented. | |
void | push (const std::vector< exprt > &_assumptions) override |
Currently, only implements a single stack element (no nested contexts) | |
void | pop () override |
Currently, only implements a single stack element (no nested contexts) | |
std::size_t | get_number_of_solver_calls () const override |
Return the number of incremental solver calls. | |
void | set_converter (irep_idt id, std::function< void(const exprt &)> converter) |
![]() | |
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 () |
Static Public Member Functions | |
static std::string | convert_identifier (const irep_idt &identifier) |
Public Attributes | |
bool | use_FPA_theory |
bool | use_array_of_bool |
bool | use_as_const |
bool | use_check_sat_assuming |
bool | use_datatypes |
bool | use_lambda_for_array |
bool | emit_set_logic |
Protected Types | |
enum class | wheret { BEGIN , END } |
using | converterst = std::unordered_map< irep_idt, std::function< void(const exprt &)>, irep_id_hash > |
typedef std::unordered_map< irep_idt, identifiert > | identifier_mapt |
typedef std::map< typet, std::string > | datatype_mapt |
typedef std::map< exprt, irep_idt > | defined_expressionst |
typedef std::set< std::string > | smt2_identifierst |
Protected Attributes | |
const namespacet & | ns |
std::ostream & | out |
std::string | benchmark |
std::string | notes |
std::string | logic |
solvert | solver |
converterst | converters |
std::vector< literalt > | assumptions |
boolbv_widtht | boolbv_width |
std::size_t | number_of_solver_calls = 0 |
letifyt | letify |
std::unordered_map< irep_idt, irept > | current_bindings |
std::set< irep_idt > | bvfp_set |
std::set< irep_idt > | state_fkt_declared |
pointer_logict | pointer_logic |
identifier_mapt | identifier_map |
datatype_mapt | datatype_map |
defined_expressionst | defined_expressions |
std::unordered_map< irep_idt, bool > | set_values |
The values which boolean identifiers have been smt2_convt::set_to or in other words those which are asserted as true / false in the output smt2 formula. | |
std::map< object_size_exprt, irep_idt > | object_sizes |
smt2_identifierst | smt2_identifiers |
std::size_t | no_boolean_variables |
std::vector< bool > | boolean_assignment |
Definition at line 40 of file smt2_conv.h.
|
protected |
Definition at line 104 of file smt2_conv.h.
|
protected |
Definition at line 271 of file smt2_conv.h.
|
protected |
Definition at line 280 of file smt2_conv.h.
|
protected |
Definition at line 263 of file smt2_conv.h.
|
protected |
Definition at line 289 of file smt2_conv.h.
|
strong |
Enumerator | |
---|---|
GENERIC | |
BITWUZLA | |
BOOLECTOR | |
CPROVER_SMT2 | |
CVC3 | |
CVC4 | |
CVC5 | |
MATHSAT | |
YICES | |
Z3 |
Definition at line 43 of file smt2_conv.h.
|
strongprotected |
Enumerator | |
---|---|
BEGIN | |
END |
Definition at line 235 of file smt2_conv.h.
smt2_convt::smt2_convt | ( | const namespacet & | _ns, |
const std::string & | _benchmark, | ||
const std::string & | _notes, | ||
const std::string & | _logic, | ||
solvert | _solver, | ||
std::ostream & | _out | ||
) |
Definition at line 56 of file smt2_conv.cpp.
|
overridedefault |
Definition at line 901 of file smt2_conv.cpp.
|
protected |
Definition at line 788 of file smt2_conv.cpp.
|
protected |
Definition at line 3444 of file smt2_conv.cpp.
Definition at line 4127 of file smt2_conv.cpp.
|
protected |
Definition at line 3603 of file smt2_conv.cpp.
Definition at line 1170 of file smt2_conv.cpp.
Definition at line 1123 of file smt2_conv.cpp.
|
protected |
Definition at line 4171 of file smt2_conv.cpp.
|
protected |
Definition at line 4107 of file smt2_conv.cpp.
|
protected |
Definition at line 4266 of file smt2_conv.cpp.
|
protected |
Definition at line 3977 of file smt2_conv.cpp.
|
protected |
Definition at line 4286 of file smt2_conv.cpp.
|
protected |
Definition at line 3293 of file smt2_conv.cpp.
|
protected |
Definition at line 3149 of file smt2_conv.cpp.
Definition at line 1025 of file smt2_conv.cpp.
|
protected |
Definition at line 4534 of file smt2_conv.cpp.
|
protected |
Definition at line 3637 of file smt2_conv.cpp.
Definition at line 966 of file smt2_conv.cpp.
|
protected |
Definition at line 4604 of file smt2_conv.cpp.
|
protected |
Definition at line 4012 of file smt2_conv.cpp.
Definition at line 3618 of file smt2_conv.cpp.
|
protected |
Definition at line 4191 of file smt2_conv.cpp.
|
protected |
Definition at line 3783 of file smt2_conv.cpp.
|
protected |
Definition at line 3674 of file smt2_conv.cpp.
Converting a constant or symbolic rounding mode to SMT-LIB.
Only called when use_FPA_theory is enabled. SMT-LIB output to is sent to out
.
Definition at line 3914 of file smt2_conv.cpp.
Definition at line 1157 of file smt2_conv.cpp.
|
protected |
Definition at line 3310 of file smt2_conv.cpp.
Definition at line 5688 of file smt2_conv.cpp.
|
protected |
Definition at line 2607 of file smt2_conv.cpp.
|
protected |
Definition at line 3416 of file smt2_conv.cpp.
|
protected |
Definition at line 4517 of file smt2_conv.cpp.
|
protected |
Definition at line 4524 of file smt2_conv.cpp.
|
protected |
Definition at line 4529 of file smt2_conv.cpp.
|
protected |
Definition at line 4309 of file smt2_conv.cpp.
|
overrideprotectedvirtual |
Implementation of the decision procedure.
Implements decision_proceduret.
Reimplemented in smt2_dect.
Definition at line 320 of file smt2_conv.cpp.
|
overridevirtual |
Return a textual description of the decision procedure.
Implements decision_proceduret.
Reimplemented in smt2_dect.
Definition at line 145 of file smt2_conv.cpp.
|
protected |
Definition at line 284 of file smt2_conv.cpp.
Definition at line 5109 of file smt2_conv.cpp.
Definition at line 5823 of file smt2_conv.cpp.
Definition at line 5829 of file smt2_conv.cpp.
Definition at line 4675 of file smt2_conv.cpp.
produce a flat bit-vector for a given array of fixed size
Definition at line 3385 of file smt2_conv.cpp.
Definition at line 1116 of file smt2_conv.cpp.
Return expr
with variables replaced by values from satisfying assignment if available.
Return nil
if not available
Implements decision_proceduret.
Definition at line 335 of file smt2_conv.cpp.
|
overridevirtual |
Return the number of incremental solver calls.
Implements decision_proceduret.
Definition at line 6030 of file smt2_conv.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 957 of file smt2_conv.cpp.
Definition at line 160 of file smt2_conv.cpp.
Lower byte_update and byte_extract operations within expr
.
Return an equivalent expression that doesn't use byte operators. Note this replaces operators post-order (compare lower_byte_operators, which uses a pre-order walk, replacing in child expressions before the parent). Pre-order replacement currently fails regression tests: see https://github.com/diffblue/cbmc/issues/4380
Definition at line 5038 of file smt2_conv.cpp.
|
protected |
This function is for parsing array output from SMT solvers when "(get-value |???|)" returns an array object.
s | is the irept parsed from the SMT output |
type | is the expected type |
Definition at line 536 of file smt2_conv.cpp.
|
protected |
Definition at line 394 of file smt2_conv.cpp.
Definition at line 703 of file smt2_conv.cpp.
|
protected |
Definition at line 634 of file smt2_conv.cpp.
|
protected |
Definition at line 618 of file smt2_conv.cpp.
|
overridevirtual |
Currently, only implements a single stack element (no nested contexts)
Implements stack_decision_proceduret.
Definition at line 1003 of file smt2_conv.cpp.
Perform steps necessary before an expression is passed to convert_expr.
expr | expression to prepare |
Definition at line 5070 of file smt2_conv.cpp.
|
overridevirtual |
Print satisfying assignment to out
.
Implements decision_proceduret.
Definition at line 150 of file smt2_conv.cpp.
|
overridevirtual |
Currently, only implements a single stack element (no nested contexts)
Implements stack_decision_proceduret.
Definition at line 994 of file smt2_conv.cpp.
|
inline |
Definition at line 94 of file smt2_conv.h.
For a Boolean expression expr
, add the constraint 'expr' if value
is true
, otherwise add 'not expr'.
Implements decision_proceduret.
Definition at line 4883 of file smt2_conv.cpp.
|
inlineprotected |
Definition at line 225 of file smt2_conv.h.
Definition at line 1060 of file smt2_conv.cpp.
Definition at line 4766 of file smt2_conv.cpp.
Definition at line 5676 of file smt2_conv.cpp.
|
protected |
This function walks the SMT output and populates a map with index/value pairs for the array.
operands_map | is a map of the operands to the array being constructed indexed by their index. |
src | is the irept source for the SMT output |
type | is the type of the array |
Definition at line 580 of file smt2_conv.cpp.
|
protected |
Writes the end of the SMT file to the smt_convt::out
stream.
These parts of the output may be changed when using multiple rounds of solving. They include the following parts of the output file -
assumptions
member variable.(check-sat)
or check-sat-assuming
command.(get-value |identifier|)
command for each of the identifiers in smt2_convt::smt2_identifiers
.(exit)
command. Definition at line 205 of file smt2_conv.cpp.
|
protected |
Definition at line 173 of file smt2_conv.cpp.
|
protected |
Definition at line 108 of file smt2_conv.h.
|
protected |
Definition at line 102 of file smt2_conv.h.
|
protected |
Definition at line 109 of file smt2_conv.h.
|
protected |
Definition at line 294 of file smt2_conv.h.
|
protected |
Definition at line 206 of file smt2_conv.h.
|
protected |
Definition at line 106 of file smt2_conv.h.
Definition at line 200 of file smt2_conv.h.
|
protected |
Definition at line 272 of file smt2_conv.h.
|
protected |
Definition at line 281 of file smt2_conv.h.
bool smt2_convt::emit_set_logic |
Definition at line 73 of file smt2_conv.h.
|
protected |
Definition at line 265 of file smt2_conv.h.
|
protected |
Definition at line 177 of file smt2_conv.h.
|
protected |
Definition at line 102 of file smt2_conv.h.
|
protected |
Definition at line 293 of file smt2_conv.h.
|
protected |
Definition at line 102 of file smt2_conv.h.
|
protected |
Definition at line 100 of file smt2_conv.h.
|
protected |
Definition at line 111 of file smt2_conv.h.
|
protected |
Definition at line 287 of file smt2_conv.h.
|
protected |
Definition at line 101 of file smt2_conv.h.
|
protected |
Definition at line 240 of file smt2_conv.h.
The values which boolean identifiers have been smt2_convt::set_to
or in other words those which are asserted as true / false in the output smt2 formula.
Definition at line 285 of file smt2_conv.h.
|
protected |
Definition at line 290 of file smt2_conv.h.
|
protected |
Definition at line 103 of file smt2_conv.h.
|
protected |
Definition at line 210 of file smt2_conv.h.
bool smt2_convt::use_array_of_bool |
Definition at line 68 of file smt2_conv.h.
bool smt2_convt::use_as_const |
Definition at line 69 of file smt2_conv.h.
bool smt2_convt::use_check_sat_assuming |
Definition at line 70 of file smt2_conv.h.
bool smt2_convt::use_datatypes |
Definition at line 71 of file smt2_conv.h.
bool smt2_convt::use_FPA_theory |
Definition at line 67 of file smt2_conv.h.
bool smt2_convt::use_lambda_for_array |
Definition at line 72 of file smt2_conv.h.