|
cprover
|
#include <smt2_conv.h>
Inheritance diagram for smt2_convt:
Collaboration diagram for smt2_convt:Classes | |
| struct | identifiert |
| class | smt2_symbolt |
Public Types | |
| enum class | solvert { GENERIC , BOOLECTOR , CPROVER_SMT2 , CVC3 , CVC4 , MATHSAT , YICES , Z3 } |
Public Types inherited from decision_proceduret | |
| 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. | |
Public Member Functions inherited from stack_decision_proceduret | |
| virtual void | push (const std::vector< exprt > &assumptions)=0 |
Pushes a new context on the stack that consists of the given (possibly empty vector of) assumptions. | |
| virtual void | push ()=0 |
| Push a new context on the stack This context becomes a child context nested in the current context. | |
| virtual void | pop ()=0 |
| Pop whatever is on top of the stack. | |
| virtual | ~stack_decision_proceduret ()=default |
Public Member Functions inherited from decision_proceduret | |
| virtual void | set_to (const exprt &expr, bool value)=0 |
For a Boolean expression expr, add the constraint 'expr' if value is true, otherwise add 'not expr'. | |
| void | set_to_true (const exprt &expr) |
For a Boolean expression expr, add the constraint 'expr'. | |
| void | set_to_false (const exprt &expr) |
For a Boolean expression expr, add the constraint 'not expr'. | |
| virtual exprt | handle (const exprt &expr)=0 |
| 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. | |
| resultt | operator() () |
| Run the decision procedure to solve the problem. | |
| virtual exprt | get (const exprt &expr) const =0 |
Return expr with variables replaced by values from satisfying assignment if available. | |
| virtual void | print_assignment (std::ostream &out) const =0 |
Print satisfying assignment to out. | |
| virtual std::string | decision_procedure_text () const =0 |
| Return a textual description of the decision procedure. | |
| virtual std::size_t | get_number_of_solver_calls () const =0 |
| Return the number of incremental solver calls. | |
| 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 } |
| 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 Member Functions | |
| resultt | dec_solve () override |
| Run the decision procedure to solve the problem. | |
| void | write_header () |
| void | write_footer () |
Writes the end of the SMT file to the smt_convt::out stream. | |
| bool | use_array_theory (const exprt &) |
| void | flatten_array (const exprt &) |
| produce a flat bit-vector for a given array of fixed size | |
| void | convert_typecast (const typecast_exprt &expr) |
| void | convert_floatbv_typecast (const floatbv_typecast_exprt &expr) |
| void | convert_struct (const struct_exprt &expr) |
| void | convert_union (const union_exprt &expr) |
| void | convert_constant (const constant_exprt &expr) |
| void | convert_relation (const binary_relation_exprt &) |
| void | convert_is_dynamic_object (const unary_exprt &) |
| void | convert_plus (const plus_exprt &expr) |
| void | convert_minus (const minus_exprt &expr) |
| void | convert_div (const div_exprt &expr) |
| void | convert_mult (const mult_exprt &expr) |
| void | convert_rounding_mode_FPA (const exprt &expr) |
| Converting a constant or symbolic rounding mode to SMT-LIB. | |
| void | convert_floatbv_plus (const ieee_float_op_exprt &expr) |
| void | convert_floatbv_minus (const ieee_float_op_exprt &expr) |
| void | convert_floatbv_div (const ieee_float_op_exprt &expr) |
| void | convert_floatbv_mult (const ieee_float_op_exprt &expr) |
| void | convert_floatbv_rem (const binary_exprt &expr) |
| void | convert_mod (const mod_exprt &expr) |
| void | convert_euclidean_mod (const euclidean_mod_exprt &expr) |
| void | convert_index (const index_exprt &expr) |
| void | convert_member (const member_exprt &expr) |
| void | convert_with (const with_exprt &expr) |
| void | convert_update (const exprt &expr) |
| void | convert_expr (const exprt &) |
| void | convert_type (const typet &) |
| void | convert_literal (const literalt) |
| literalt | convert (const exprt &expr) |
| tvt | l_get (literalt l) const |
| exprt | prepare_for_convert_expr (const exprt &expr) |
| Perform steps necessary before an expression is passed to convert_expr. | |
| exprt | lower_byte_operators (const exprt &expr) |
Lower byte_update and byte_extract operations within expr. | |
| void | find_symbols (const exprt &expr) |
| void | find_symbols (const typet &type) |
| void | find_symbols_rec (const typet &type, std::set< irep_idt > &recstack) |
| constant_exprt | parse_literal (const irept &, const typet &type) |
| struct_exprt | parse_struct (const irept &s, const struct_typet &type) |
| exprt | parse_union (const irept &s, const union_typet &type) |
| exprt | parse_array (const irept &s, const array_typet &type) |
| This function is for parsing array output from SMT solvers when "(get-value |???|)" returns an array object. | |
| exprt | parse_rec (const irept &s, const typet &type) |
| void | walk_array_tree (std::unordered_map< int64_t, exprt > *operands_map, const irept &src, const array_typet &type) |
| This function walks the SMT output and populates a map with index/value pairs for the array. | |
| void | convert_floatbv (const exprt &expr) |
| std::string | type2id (const typet &) const |
| std::string | floatbv_suffix (const exprt &) const |
| const smt2_symbolt & | to_smt2_symbol (const exprt &expr) |
| void | flatten2bv (const exprt &) |
| void | unflatten (wheret, const typet &, unsigned nesting=0) |
| void | convert_address_of_rec (const exprt &expr, const pointer_typet &result_type) |
| void | define_object_size (const irep_idt &id, const exprt &expr) |
| virtual resultt | dec_solve ()=0 |
| Run the decision procedure to solve the problem. | |
Protected Attributes | |
| const namespacet & | ns |
| std::ostream & | out |
| std::string | benchmark |
| std::string | notes |
| std::string | logic |
| solvert | solver |
| std::vector< exprt > | assumptions |
| boolbv_widtht | boolbv_width |
| std::size_t | number_of_solver_calls = 0 |
| letifyt | letify |
| std::set< irep_idt > | bvfp_set |
| 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. | |
| defined_expressionst | object_sizes |
| smt2_identifierst | smt2_identifiers |
| std::size_t | no_boolean_variables |
| std::vector< bool > | boolean_assignment |
Definition at line 35 of file smt2_conv.h.
|
protected |
Definition at line 243 of file smt2_conv.h.
|
protected |
Definition at line 252 of file smt2_conv.h.
|
protected |
Definition at line 235 of file smt2_conv.h.
|
protected |
Definition at line 261 of file smt2_conv.h.
|
strong |
| Enumerator | |
|---|---|
| GENERIC | |
| BOOLECTOR | |
| CPROVER_SMT2 | |
| CVC3 | |
| CVC4 | |
| MATHSAT | |
| YICES | |
| Z3 | |
Definition at line 38 of file smt2_conv.h.
|
strongprotected |
| Enumerator | |
|---|---|
| BEGIN | |
| END | |
Definition at line 210 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 794 of file smt2_conv.cpp.
|
protected |
Definition at line 702 of file smt2_conv.cpp.
|
protected |
Definition at line 2955 of file smt2_conv.cpp.
|
protected |
Definition at line 3629 of file smt2_conv.cpp.
|
protected |
Definition at line 3100 of file smt2_conv.cpp.
|
protected |
Definition at line 989 of file smt2_conv.cpp.
|
protected |
Definition at line 955 of file smt2_conv.cpp.
|
protected |
Definition at line 3673 of file smt2_conv.cpp.
|
protected |
Definition at line 3609 of file smt2_conv.cpp.
|
protected |
Definition at line 3768 of file smt2_conv.cpp.
|
protected |
Definition at line 3471 of file smt2_conv.cpp.
|
protected |
Definition at line 3788 of file smt2_conv.cpp.
|
protected |
Definition at line 2683 of file smt2_conv.cpp.
|
static |
Definition at line 880 of file smt2_conv.cpp.
|
protected |
Definition at line 4065 of file smt2_conv.cpp.
|
protected |
Definition at line 3134 of file smt2_conv.cpp.
|
protected |
Definition at line 843 of file smt2_conv.cpp.
|
protected |
Definition at line 4163 of file smt2_conv.cpp.
|
protected |
Definition at line 3512 of file smt2_conv.cpp.
|
protected |
Definition at line 3115 of file smt2_conv.cpp.
|
protected |
Definition at line 3693 of file smt2_conv.cpp.
|
protected |
Definition at line 3278 of file smt2_conv.cpp.
|
protected |
Definition at line 3171 of file smt2_conv.cpp.
|
protected |
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 3414 of file smt2_conv.cpp.
|
protected |
Definition at line 2827 of file smt2_conv.cpp.
|
protected |
Definition at line 4876 of file smt2_conv.cpp.
|
protected |
Definition at line 2150 of file smt2_conv.cpp.
|
protected |
Definition at line 2922 of file smt2_conv.cpp.
|
protected |
Definition at line 4058 of file smt2_conv.cpp.
|
protected |
Definition at line 3811 of file smt2_conv.cpp.
|
overrideprotectedvirtual |
Run the decision procedure to solve the problem.
Implements decision_proceduret.
Reimplemented in smt2_dect.
Definition at line 274 of file smt2_conv.cpp.
|
overridevirtual |
Return a textual description of the decision procedure.
Implements decision_proceduret.
Reimplemented in smt2_dect.
Definition at line 127 of file smt2_conv.cpp.
Definition at line 236 of file smt2_conv.cpp.
|
protected |
Definition at line 4572 of file smt2_conv.cpp.
|
protected |
Definition at line 5014 of file smt2_conv.cpp.
Definition at line 5020 of file smt2_conv.cpp.
|
protected |
Definition at line 4224 of file smt2_conv.cpp.
|
protected |
produce a flat bit-vector for a given array of fixed size
Definition at line 2891 of file smt2_conv.cpp.
|
protected |
Definition at line 948 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 281 of file smt2_conv.cpp.
|
overridevirtual |
Return the number of incremental solver calls.
Implements decision_proceduret.
Definition at line 5226 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 834 of file smt2_conv.cpp.
Definition at line 142 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 4525 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 479 of file smt2_conv.cpp.
|
protected |
Definition at line 341 of file smt2_conv.cpp.
Definition at line 638 of file smt2_conv.cpp.
|
protected |
Definition at line 579 of file smt2_conv.cpp.
|
protected |
Definition at line 563 of file smt2_conv.cpp.
|
overridevirtual |
Currently, only implements a single stack element (no nested contexts)
Implements stack_decision_proceduret.
Definition at line 875 of file smt2_conv.cpp.
Perform steps necessary before an expression is passed to convert_expr.
| expr | expression to prepare |
Definition at line 4557 of file smt2_conv.cpp.
|
overridevirtual |
Print satisfying assignment to out.
Implements decision_proceduret.
Definition at line 132 of file smt2_conv.cpp.
|
overridevirtual |
|
overridevirtual |
Currently, only implements a single stack element (no nested contexts)
Implements stack_decision_proceduret.
Definition at line 868 of file smt2_conv.cpp.
|
overridevirtual |
For a Boolean expression expr, add the constraint 'expr' if value is true, otherwise add 'not expr'.
Implements decision_proceduret.
Definition at line 4417 of file smt2_conv.cpp.
|
inlineprotected |
Definition at line 200 of file smt2_conv.h.
|
protected |
Definition at line 911 of file smt2_conv.cpp.
Definition at line 4313 of file smt2_conv.cpp.
|
protected |
Definition at line 4855 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 523 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 185 of file smt2_conv.cpp.
|
protected |
Definition at line 155 of file smt2_conv.cpp.
|
protected |
Definition at line 93 of file smt2_conv.h.
|
protected |
Definition at line 90 of file smt2_conv.h.
|
protected |
Definition at line 94 of file smt2_conv.h.
|
protected |
Definition at line 266 of file smt2_conv.h.
|
protected |
Definition at line 185 of file smt2_conv.h.
|
protected |
Definition at line 244 of file smt2_conv.h.
|
protected |
Definition at line 253 of file smt2_conv.h.
| bool smt2_convt::emit_set_logic |
Definition at line 66 of file smt2_conv.h.
|
protected |
Definition at line 237 of file smt2_conv.h.
|
protected |
Definition at line 157 of file smt2_conv.h.
|
protected |
Definition at line 90 of file smt2_conv.h.
|
protected |
Definition at line 265 of file smt2_conv.h.
|
protected |
Definition at line 90 of file smt2_conv.h.
|
protected |
Definition at line 88 of file smt2_conv.h.
|
protected |
Definition at line 96 of file smt2_conv.h.
|
protected |
Definition at line 259 of file smt2_conv.h.
|
protected |
Definition at line 89 of file smt2_conv.h.
|
protected |
Definition at line 215 of file smt2_conv.h.
|
protected |
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 257 of file smt2_conv.h.
|
protected |
Definition at line 262 of file smt2_conv.h.
|
protected |
Definition at line 91 of file smt2_conv.h.
| bool smt2_convt::use_array_of_bool |
Definition at line 61 of file smt2_conv.h.
| bool smt2_convt::use_as_const |
Definition at line 62 of file smt2_conv.h.
| bool smt2_convt::use_check_sat_assuming |
Definition at line 63 of file smt2_conv.h.
| bool smt2_convt::use_datatypes |
Definition at line 64 of file smt2_conv.h.
| bool smt2_convt::use_FPA_theory |
Definition at line 60 of file smt2_conv.h.
| bool smt2_convt::use_lambda_for_array |
Definition at line 65 of file smt2_conv.h.