ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
smt_solver.h
Go to the documentation of this file.
1#ifndef _ESBMC_PROP_SMT_SMT_SOLVER_H_
2#define _ESBMC_PROP_SMT_SMT_SOLVER_H_
3
4#include <optional>
5#include <boost/multi_index/hashed_index.hpp>
6#include <boost/multi_index/member.hpp>
7#include <boost/multi_index/ordered_index.hpp>
8#include <boost/multi_index_container.hpp>
9#include <memory>
10#include <mutex>
11#include <set>
12#include <utility>
13#include <unordered_map>
14#include <unordered_set>
18#include <irep2/irep2_utils.h>
21#include <util/base/threeval.h>
22
93
94// Forward dec.
95class fp_convt;
96class ir_ieee_convt;
98
102
107
110unsigned flattened_position(unsigned offset, unsigned width, unsigned total);
111
114expr2tc union_member_bits(const expr2tc &bits, unsigned width);
115
119 const expr2tc &rest,
120 const expr2tc &member,
121 unsigned bits);
122
125expr2tc union_bits_of_member(const expr2tc &member, unsigned bits);
126class ra_apit;
127
131
170{
171public:
173 typedef std::vector<smt_astt> ast_vec;
174
175 template <typename the_solver_ast>
177 new_solver_ast(typename the_solver_ast::solver_ast_type ast, smt_sortt sort)
178 {
179 return new the_solver_ast(this, ast, sort);
180 }
181
188 smt_solver_baset(const namespacet &_ns, const optionst &_options);
189
191
197 void smt_post_init();
198
199 // The API that we provide to the rest of the world:
202
204 virtual void push_ctx();
206 virtual void pop_ctx();
207
211 virtual bool has_model() const
212 {
213 return true;
214 }
215
223 smt_astt convert_ast(const expr2tc &expr);
224
231 smt_astt convert_ast_node(const expr2tc &expr);
232
237
248 const expr2tc &expr,
249 const type2tc &type,
250 smt_astt const *args,
251 struct expr_op_convert ops);
252
253 smt_astt convert_assign(const expr2tc &expr);
259 void define(const expr2tc &expr);
260
264 void dump_expr(const expr2tc &expr);
265
268
273
279
285 virtual void assert_ast(smt_astt a) = 0;
286
293 virtual smt_resultt dec_solve() = 0;
294
297 virtual smt_resultt dec_solve_assuming(const ast_vec &assumptions);
298 virtual bool supports_assumptions() const
299 {
300 return false;
301 }
302
303 void pre_solve();
304
310 virtual expr2tc get_by_type(const expr2tc &expr);
311
318 virtual expr2tc get_by_ast(const type2tc &type, smt_astt a);
319
325 expr2tc get_by_ast(const expr2tc &expr);
326
332
340 virtual bool get_rational(smt_astt a, BigInt &numerator, BigInt &denominator)
341 {
342 // Default implementation returns false - solver-specific implementations
343 // should override this
344 (void)a;
345 (void)numerator;
346 (void)denominator;
347 return false;
348 }
349
360 std::optional<expr2tc> get_index_value(const expr2tc &expr, expr2tc &res);
363 std::optional<expr2tc> get_index(const expr2tc &expr, expr2tc &res);
364
365 virtual expr2tc get(const expr2tc &expr);
366
370 virtual const std::string solver_text() = 0;
371
377 virtual tvt l_get(smt_astt a);
378
380 tvt l_get(const expr2tc &expr);
381
383
387
388 virtual smt_astt mk_add(smt_astt a, smt_astt b);
389 virtual smt_astt mk_bvadd(smt_astt a, smt_astt b);
390 virtual smt_astt mk_sub(smt_astt a, smt_astt b);
391 virtual smt_astt mk_bvsub(smt_astt a, smt_astt b);
392 virtual smt_astt mk_mul(smt_astt a, smt_astt b);
393 virtual smt_astt mk_bvmul(smt_astt a, smt_astt b);
394 virtual smt_astt mk_mod(smt_astt a, smt_astt b);
395 virtual smt_astt mk_bvsmod(smt_astt a, smt_astt b);
396 virtual smt_astt mk_bvumod(smt_astt a, smt_astt b);
397 virtual smt_astt mk_div(smt_astt a, smt_astt b);
398 virtual smt_astt mk_bvsdiv(smt_astt a, smt_astt b);
399 virtual smt_astt mk_bvudiv(smt_astt a, smt_astt b);
400 virtual smt_astt mk_shl(smt_astt a, smt_astt b);
401 virtual smt_astt mk_bvshl(smt_astt a, smt_astt b);
402 virtual smt_astt mk_bvashr(smt_astt a, smt_astt b);
403 virtual smt_astt mk_bvlshr(smt_astt a, smt_astt b);
404 virtual smt_astt mk_neg(smt_astt a);
405 virtual smt_astt mk_bvneg(smt_astt a);
406 virtual smt_astt mk_bvnot(smt_astt a);
407 virtual smt_astt mk_bvxor(smt_astt a, smt_astt b);
408 virtual smt_astt mk_bvor(smt_astt a, smt_astt b);
409 virtual smt_astt mk_bvand(smt_astt a, smt_astt b);
410 virtual smt_astt mk_implies(smt_astt a, smt_astt b);
411 virtual smt_astt mk_xor(smt_astt a, smt_astt b);
412 virtual smt_astt mk_or(smt_astt a, smt_astt b);
413 virtual smt_astt mk_and(smt_astt a, smt_astt b);
414 virtual smt_astt mk_not(smt_astt a);
415 virtual smt_astt mk_lt(smt_astt a, smt_astt b);
416 virtual smt_astt mk_bvult(smt_astt a, smt_astt b);
417 virtual smt_astt mk_bvslt(smt_astt a, smt_astt b);
418 virtual smt_astt mk_gt(smt_astt a, smt_astt b);
419 virtual smt_astt mk_bvugt(smt_astt a, smt_astt b);
420 virtual smt_astt mk_bvsgt(smt_astt a, smt_astt b);
421 virtual smt_astt mk_le(smt_astt a, smt_astt b);
422 virtual smt_astt mk_bvule(smt_astt a, smt_astt b);
423 virtual smt_astt mk_bvsle(smt_astt a, smt_astt b);
424 virtual smt_astt mk_ge(smt_astt a, smt_astt b);
425 virtual smt_astt mk_bvuge(smt_astt a, smt_astt b);
426 virtual smt_astt mk_bvsge(smt_astt a, smt_astt b);
427 virtual smt_astt mk_eq(smt_astt a, smt_astt b);
428 virtual smt_astt mk_neq(smt_astt a, smt_astt b);
429 virtual smt_astt mk_store(smt_astt a, smt_astt b, smt_astt c);
430 virtual smt_astt mk_select(smt_astt a, smt_astt b);
431 virtual smt_astt mk_real2int(smt_astt a);
432 virtual smt_astt mk_int2real(smt_astt a);
433 virtual smt_astt mk_isint(smt_astt a);
434 virtual smt_astt
435 mk_quantifier(bool is_forall, std::vector<smt_astt> lhs, smt_astt rhs)
436 {
437 (void)is_forall;
438 (void)lhs;
439 (void)rhs;
440 abort();
441 }
442
444 smt_astt left_ast,
445 smt_astt right_ast,
446 const expr2tc &expr);
447
449 smt_sortt mk_int_bv_sort(std::size_t width)
450 {
451 if (int_encoding)
452 return mk_int_sort();
453
454 if (width == 0)
455 width = 1;
456
457 return mk_bv_sort(width);
458 }
459
461 smt_sortt mk_real_fp_sort(std::size_t ew, std::size_t sw)
462 {
463 if (int_encoding)
464 return mk_real_sort();
465
466 if (config.ansi_c.use_fixed_for_float)
467 return mk_fbv_sort(ew + sw);
468
469 return fp_api->mk_fpbv_sort(ew, sw);
470 }
471
473 virtual smt_sortt mk_bool_sort();
474
476 virtual smt_sortt mk_real_sort();
477
479 virtual smt_sortt mk_int_sort();
480
482 virtual smt_sortt mk_bv_sort(std::size_t width);
483
485 virtual smt_sortt mk_fbv_sort(std::size_t width);
486
488 virtual smt_sortt mk_bvfp_sort(std::size_t ew, std::size_t sw);
489
491 virtual smt_sortt mk_bvfp_rm_sort();
492
495
500 virtual smt_astt mk_smt_int(const BigInt &theint) = 0;
501
517 virtual smt_astt mk_smt_real(const std::string &str) = 0;
518
519 // Returns SMT AST representing real zero
521 // Returns SMT AST representing double precision minimum normal value
522 // (2^-1022)
524 // Returns SMT AST representing double precision minimum subnormal value
525 // (2^-1074)
527 // Returns SMT AST representing double precision maximum normal value
528 // (~1.7976931348623157e+308)
530 // Returns SMT AST representing single precision minimum normal value (2^-126)
532 // Returns SMT AST representing single precision minimum subnormal value
533 // (2^-149)
535 // Returns SMT AST representing single precision maximum normal value
536 // (~3.4028234663852886e+38)
538 // Under --ir-ieee, returns real zero when r lies in the region that
539 // rounds to zero under the selected rounding mode; otherwise returns r
540 // unchanged. This models only the zero/nonzero underflow boundary:
541 // signed zero and subnormal-grid quantization are not represented.
542 // Returns r unchanged for unsupported float formats.
544 smt_astt r,
545 const floatbv_type2t &fbv_type,
546 const expr2tc &rounding_mode);
547
548 // Returns SMT AST for the integer-encoding sentinel for double +∞:
549 // max_normal+1
551 // Returns SMT AST for the integer-encoding sentinel for single +∞:
552 // max_normal+1
554 // Returns SMT AST for the double precision relative error bound under
555 // round-to-nearest: half machine epsilon = 2^-53 ~ 1.11e-16
557 // Returns SMT AST for the single precision relative error bound under
558 // round-to-nearest: half machine epsilon = 2^-24 ~ 5.96e-08
560 // Returns SMT AST for the double precision directional error bound under
561 // round-toward-+inf: full machine epsilon = 2^-52 ~ 2.22e-16
563 // Returns SMT AST for the single precision directional error bound under
564 // round-toward-+inf: full machine epsilon = 2^-23 ~ 1.19e-07
566
572 virtual smt_astt mk_smt_bv(const BigInt &theint, std::size_t w)
573 {
574 return mk_smt_bv(theint, mk_int_bv_sort(w));
575 }
576
582 virtual smt_astt mk_smt_bv(const BigInt &theint, smt_sortt s) = 0;
583
587 virtual smt_astt mk_smt_bool(bool val) = 0;
588
595 virtual smt_astt mk_smt_symbol(const std::string &name, smt_sortt s) = 0;
596
612 const std::string &name,
613 const std::vector<smt_astt> &args,
614 smt_sortt rangesort);
615
623 virtual smt_astt
624 mk_extract(smt_astt a, unsigned int high, unsigned int low) = 0;
625
631 virtual smt_astt mk_sign_ext(smt_astt a, unsigned int topwidth) = 0;
632
634 virtual smt_astt mk_zero_ext(smt_astt a, unsigned int topwidth) = 0;
635
641
648
654 virtual tvt get_bool(smt_astt a) = 0;
655
660 virtual BigInt get_bv(smt_astt a, bool is_signed) = 0;
661
667
673
675
678
685 virtual smt_astt overflow_arith(const expr2tc &expr);
686
692 virtual smt_astt overflow_cast(const expr2tc &expr);
693
700 virtual smt_astt overflow_neg(const expr2tc &expr);
701
726 smt_astt real_result,
727 const floatbv_type2t &fbv_type,
728 smt_astt operand_zero_check = nullptr,
729 const expr2tc &rounding_mode = expr2tc());
730
732 virtual std::string dump_smt();
733
735 virtual void print_model();
736
738
741
748 virtual smt_astt convert_array_index(const expr2tc &expr);
749
754 virtual smt_astt convert_array_store(const expr2tc &expr);
755
757
760
763 virtual smt_astt
764 mk_fresh(smt_sortt s, const std::string &tag, smt_sortt st = nullptr);
766 std::string mk_fresh_name(const std::string &tag);
767
769 const expr2tc &guard,
770 const expr2tc &addr_symbol,
771 const expr2tc &new_size);
772
776 smt_sortt convert_sort(const type2tc &type);
780 smt_astt convert_terminal(const expr2tc &expr);
781
786 smt_astt convert_pointer_arith(const expr2tc &expr, const type2tc &t);
791 smt_astt divide_by_element_size(const expr2tc &diff, const expr2tc &size);
802 const expr2tc &expr,
803 const expr2tc &expr2,
804 const expr2tc &templ_expr);
809 smt_astt convert_addr_of(const expr2tc &expr);
811 smt_astt convert_member(const expr2tc &expr);
822 const expr2tc &expr,
823 const std::string &sym,
824 const typet *type);
825
829 unsigned int obj_num,
830 const expr2tc &size,
831 const typet *type,
832 bool may_be_freed);
833
835 smt_astt convert_is_nan(const expr2tc &expr);
837 smt_astt convert_is_inf(const expr2tc &expr);
843 smt_astt convert_signbit(const expr2tc &expr);
845 smt_astt convert_popcount(const expr2tc &expr);
847 smt_astt convert_bswap(const expr2tc &expr);
853 /* Integer mode byte extraction helper functions */
855 const byte_extract2t &data,
856 expr2tc source,
857 expr2tc offs,
858 unsigned int src_width);
859 /* Bit-vector mode byte extraction helper functions */
861 const byte_extract2t &data,
862 expr2tc source,
863 expr2tc offs,
864 unsigned int src_width);
865 /* Helper function for integer arithmetic right shift simulation */
866 expr2tc create_int_right_shift(expr2tc source, expr2tc shift_amount);
876 const byte_update2t &data,
877 expr2tc source,
878 expr2tc offs,
879 expr2tc update_value,
880 unsigned int src_width);
885 smt_astt convert_bitcast(const expr2tc &expr);
889 smt_astt convert_pointer_bitcast(const expr2tc &from, const type2tc &to_type);
890 smt_astt convert_bitcast_to_fp(const expr2tc &from, const type2tc &to_type);
892 convert_bitcast_to_struct(const expr2tc &from, const type2tc &to_type);
896 smt_astt encode_pointer_repr(const expr2tc &ptr, const type2tc &to_type);
897 smt_astt decode_pointer_repr(const expr2tc &repr, const type2tc &to_type);
900 bool pointer_repr_applies(const type2tc &ptr_type, const type2tc &bv_type);
902 void assert_expr(const expr2tc &e);
908 const expr2tc &expr,
909 std::unordered_set<const expr2t *> &seen);
912 smt_astt convert_modulus(const modulus2t &m, smt_astt a, smt_astt b);
918 smt_astt array_create(const expr2tc &expr);
919
924 void set_tuple_iface(tuple_iface *iface);
926 void set_array_iface(array_iface *iface);
928 void set_fp_conv(fp_convt *iface);
930 void set_ra_conv(ra_apit *iface);
931
932 void bump_addrspace_array(unsigned int idx, const expr2tc &val);
934 std::string get_cur_addrspace_ident();
935
937 std::set<std::pair<expr2tc, expr2tc>> divided_operand_pairs;
941 void finalize_pointer_chain(unsigned int obj_num);
942
963 smt_astt convert_typecast(const expr2tc &expr);
972 round_fixedbv_to_int(smt_astt a, unsigned int width, unsigned int towidth);
977 smt_astt int_val,
978 const floatbv_type2t &fbv_type,
979 unsigned int source_width);
980
983
988
991 expr2tc fix_array_idx(const expr2tc &idx, const type2tc &array_type);
1001
1004 void rewrite_ptrs_to_structs(type2tc &type);
1005
1013
1021
1026 void expand_row_stores(
1027 const expr2tc &row,
1028 const expr2tc &offset,
1029 std::vector<flat_storet> &stores);
1030
1034 bool decompose_stores(
1035 const expr2tc &expr,
1036 const expr2tc &offset,
1037 std::vector<flat_storet> &stores,
1038 expr2tc &base);
1039
1045 smt_astt pointer_array_of(const expr2tc &init_val, unsigned long array_width);
1046
1047 unsigned int
1048 get_member_name_field(const type2tc &t, const irep_idt &name) const;
1049 unsigned int
1050 get_member_name_field(const type2tc &t, const expr2tc &name) const;
1051
1052 // Ours:
1055 expr2tc get_array(const type2tc &type, smt_astt array);
1056 expr2tc get_array(const expr2tc &expr);
1057
1058 void delete_all_asts();
1059
1061
1062 // Types
1063
1064 // Type for (optional) AST cache
1065
1067 {
1070 unsigned int level;
1071 };
1072
1073 typedef boost::multi_index_container<
1075 boost::multi_index::indexed_by<
1076 boost::multi_index::hashed_unique<
1077 BOOST_MULTI_INDEX_MEMBER(smt_cache_entryt, const expr2tc, val)>,
1078 boost::multi_index::ordered_non_unique<
1079 BOOST_MULTI_INDEX_MEMBER(smt_cache_entryt, unsigned int, level),
1080 std::greater<unsigned int>>>>
1082
1083 typedef std::unordered_map<type2tc, smt_sortt, type2_hash> smt_sort_cachet;
1084
1085 // Members
1087 unsigned int ctx_level;
1088
1095
1101 std::unordered_map<smt_astt, tvt> l_get_cache;
1108 std::unordered_map<smt_astt, std::pair<type2tc, expr2tc>> get_ast_cache;
1112 std::list<pointer_logict> pointer_logic;
1129 /* Options contain all the parameters set by the user to run ESBMC */
1131
1133
1136
1139
1145 {
1146 std::vector<smt_astt> args;
1148 unsigned int level;
1149 };
1150
1155 std::unordered_map<std::string, std::vector<uf_ackermann_entry>>
1159
1172
1174 std::vector<ptr_flatten_entry> ptr_flatten_history;
1177 static constexpr size_t max_rebuild_sources = 32;
1180 std::unordered_map<expr2tc, ptr_flatten_entry, irep2_hash> flattened;
1181 void record_flattened_pointer(smt_astt address, smt_astt pointer);
1182
1187 std::set<size_t> step_sources;
1188 std::set<size_t> step_flattens;
1189 std::string step_assigned;
1191 size_t flatten_count = 0;
1194 std::unordered_map<std::string, std::pair<unsigned int, std::set<size_t>>>
1196 void begin_step(const expr2tc &guard, const expr2tc &cond);
1197 void note_assignment(const expr2tc &lhs, const expr2tc &rhs);
1198 void end_step();
1199
1204 std::unordered_map<irep_idt, expr2tc, irep_id_hash> forall_defs_;
1205
1210 std::map<std::string, unsigned int> fresh_map;
1211
1216 std::list<unsigned int> addr_space_sym_num;
1224 std::list<std::map<unsigned, bool>> addr_space_data;
1225
1229
1230 // XXX - push-pop will break here.
1231 typedef std::map<std::string, smt_astt> renumber_mapt;
1232 std::vector<renumber_mapt> renumber_map;
1233
1236 std::vector<smt_astt> live_asts;
1240 std::vector<unsigned int> live_asts_sizes;
1241
1245 ra_apit *ra_api;
1246 std::unique_ptr<ir_ieee_convt> ir_ieee_api;
1247
1248 // Workaround for integer shifts. This is an array of the powers of two,
1249 // up to 2^64.
1251
1252private:
1253 expr2tc get_by_ast_uncached(const type2tc &type, smt_astt a);
1254
1255 double convert_rational_to_double(
1256 const BigInt &numerator,
1257 const BigInt &denominator);
1258};
1259
1262
1267unsigned long array_domain_width_or_word_size(const array_type2t &arr);
1268
1269// Define here to enable inlining
1271 : sort(s), context(ctx)
1272{
1273 assert(sort != nullptr);
1274 ctx->live_asts.push_back(this);
1275}
1276
1277/* Type for push/pop-aware symbol table cache, required by some solvers */
1278
1280{
1281 std::string val;
1283 unsigned int level;
1284
1285 symtab_entryt(std::string val, smt_astt ast, unsigned int level)
1286 : val(std::move(val)), ast(ast), level(level)
1287 {
1288 }
1289};
1290
1291typedef boost::multi_index_container<
1293 boost::multi_index::indexed_by<
1294 boost::multi_index::hashed_unique<
1295 BOOST_MULTI_INDEX_MEMBER(symtab_entryt, std::string, val)>,
1296 boost::multi_index::ordered_non_unique<
1297 BOOST_MULTI_INDEX_MEMBER(symtab_entryt, unsigned int, level),
1298 std::greater<unsigned int>>>>
1300
1301#endif /* _ESBMC_PROP_SMT_SMT_SOLVER_H_ */
static const twodig_t base
Definition bigint.cpp:28
Definition bigint.hh:58
Definition smt_array.h:10
Array type.
Definition irep2_type.h:422
Definition toml.hpp:6607
Extract byte from data.
Definition irep2_expr.h:1493
Update byte.
Definition irep2_expr.h:1533
Floating-point bitvector type.
Definition irep2_type.h:621
Definition fp_conv.h:8
Encapsulates the integer-encoding IEEE 754 path (–int-encoding –ir-ieee).
Definition ir_ieee_conv.h:28
Definition irep_idt.h:12
Definition namespace.h:10
Definition options.h:11
const smt_solver_baset * context
The solver context.
Definition smt_ast.h:39
smt_sortt sort
The sort of this function application.
Definition smt_ast.h:36
smt_ast(smt_solver_baset *ctx, smt_sortt s)
Definition smt_solver.h:1270
The base SMT-conversion class/interface.
Definition smt_solver.h:170
smt_solver_baset(const namespacet &_ns, const optionst &_options)
Primary constructor.
Definition smt_solver.cpp:78
virtual expr2tc get(const expr2tc &expr)
Definition smt_solver.cpp:3453
virtual smt_astt mk_ge(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4781
virtual smt_astt mk_extract(smt_astt a, unsigned int high, unsigned int low)=0
Create an 'extract' func app.
expr2tc create_int_right_shift(expr2tc source, expr2tc shift_amount)
Definition smt_byteops.cpp:208
virtual smt_astt mk_bvsmod(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4580
type2tc addr_space_type
Type of the address space allocation records.
Definition smt_solver.h:1219
smt_astt invert_ast(smt_astt a)
Create the inverse of an smt_ast.
Definition smt_solver.cpp:302
expr2tc step_overwritten
Definition smt_solver.h:1190
virtual expr2tc get_by_ast(const type2tc &type, smt_astt a)
Get the satisfying assignment using the ast.
Definition smt_solver.cpp:3654
smt_astt invalid_ptr_ast
Definition smt_solver.h:1135
bool ptr_foo_inited
Definition smt_solver.h:1132
expr2tc fix_array_idx(const expr2tc &idx, const type2tc &array_type)
Given an array index, extract the lower n bits of it, where n is the bitwidth of the array domain.
Definition smt_solver.cpp:2658
virtual smt_astt mk_smt_bv(const BigInt &theint, std::size_t w)
Create a bitvector.
Definition smt_solver.h:572
static constexpr size_t max_rebuild_sources
The most flattens one rebuilt pointer is defined over; see decode_pointer_repr().
Definition smt_solver.h:1177
virtual smt_astt mk_smt_bv(const BigInt &theint, smt_sortt s)=0
Create a bitvector.
std::optional< expr2tc > get_index(const expr2tc &expr, expr2tc &res)
get_index_value(), returning the element it read from the model, if any, rather than leaving it in re...
Definition smt_solver.cpp:3383
unsigned int get_member_name_field(const type2tc &t, const irep_idt &name) const
Definition smt_solver.cpp:45
std::unordered_map< std::string, std::pair< unsigned int, std::set< size_t > > > ptr_flow
The flattens each SSA symbol's value may hold, and the context level it was recorded at.
Definition smt_solver.h:1195
virtual smt_resultt dec_solve_assuming(const ast_vec &assumptions)
Solve with each boolean ast in assumptions held true for this query only.
Definition smt_solver.cpp:3360
smt_astt get_double_eps_rel()
Definition smt_fp_conv.cpp:611
virtual tvt get_bool(smt_astt a)=0
Extract the assignment to a boolean variable from the SMT solver's model.
smt_astt round_real_to_int(smt_astt a)
Round a real to an integer; not straightforward at all.
Definition smt_solver.cpp:2471
smt_astt convert_typecast_to_ints_from_unsigned(const typecast2t &cast)
Definition smt_casts.cpp:320
void pre_solve()
Definition smt_solver.cpp:3366
virtual smt_astt mk_bvult(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4723
virtual smt_astt mk_mul(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4559
tuple_iface * tuple_api
Definition smt_solver.h:1242
smt_astt make_bit_bool(smt_astt a)
Convert a bitvector with one bit to a boolean.
Definition smt_solver.cpp:2615
smt_astt step_guard
The SSA step being converted: its guard, the flattens its operands may hold (all a rebuild in it read...
Definition smt_solver.h:1186
std::string mk_fresh_name(const std::string &tag)
Create a previously un-used variable name with the prefix given in tag.
Definition smt_solver.cpp:2288
smt_astt convert_identifier_pointer(const expr2tc &expr, const std::string &sym, const typet *type)
Convert an identifier to a pointer.
Definition smt_memspace.cpp:315
smt_astt convert_typecast_to_ints_from_fbv_sint(const typecast2t &cast)
Definition smt_casts.cpp:278
virtual smt_astt mk_bvxor(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4661
void set_array_iface(array_iface *iface)
Stores handle for the array interface.
Definition smt_solver.cpp:139
virtual smt_astt mk_smt_bool(bool val)=0
Create a boolean.
ra_apit * ra_api
Definition smt_solver.h:1245
expr2tc decompose_store_chain(const expr2tc &expr, expr2tc &base)
Like decompose_select_chain, but for multidimensional stores.
Definition smt_solver.cpp:2875
smt_sortt convert_sort(const type2tc &type)
Convert a type2tc into an smt_sort.
Definition smt_solver.cpp:1927
smt_astt tuple_array_create_despatch(const expr2tc &expr, smt_sortt domain)
Prep call for creating a tuple array.
Definition smt_solver.cpp:4239
smt_astt round_int_to_fp(smt_astt int_val, const floatbv_type2t &fbv_type, unsigned int source_width)
Round an SMT integer to the nearest representable float/double using IEEE 754 round-to-nearest-even.
Definition smt_solver.cpp:2493
virtual smt_sortt mk_int_sort()
Create a int sort.
Definition smt_solver.cpp:4472
virtual smt_sortt mk_bool_sort()
Create a bool sort.
Definition smt_solver.cpp:4460
virtual smt_sortt mk_array_sort(smt_sortt domain, smt_sortt range)
Create an array sort.
Definition smt_solver.cpp:4490
smt_astt convert_typecast_to_fpbv(const typecast2t &cast)
Typecast to a floatbv.
Definition smt_casts.cpp:150
smt_astt convert_bswap(const expr2tc &expr)
Converts bswap representation.
Definition smt_solver.cpp:2352
const optionst & options
Definition smt_solver.h:1130
virtual smt_astt mk_fresh(smt_sortt s, const std::string &tag, smt_sortt st=nullptr)
Create a free variable with the given sort, and a unique name, with the prefix given in 'tag'.
Definition smt_solver.cpp:2296
virtual smt_astt mk_smt_real(const std::string &str)=0
Create a real in a smt_ast.
virtual smt_astt mk_not(smt_astt a)
Definition smt_solver.cpp:4710
type2tc machine_ptr
The type of the machine integer that can store a pointer.
Definition smt_solver.h:1117
virtual expr2tc get_by_type(const expr2tc &expr)
Get the satisfying assignment using the type.
Definition smt_solver.cpp:3933
smt_astt make_n_ary_and(const ast_vec &v)
Definition smt_solver.cpp:2645
smt_astt decode_pointer_repr(const expr2tc &repr, const type2tc &to_type)
Definition smt_bitcast.cpp:400
smt_astt get_double_min_normal()
Definition smt_fp_conv.cpp:19
void define(const expr2tc &expr)
Bind the symbol on the left of an equality to its right-hand side without asserting anything: later c...
Definition smt_solver.cpp:366
smt_astt mk_truncated_div(const type2tc &type, smt_astt a, smt_astt b)
C's / and % of signed type on Int-sorted operands, from the solver's Euclidean div/mod (#8662).
Definition smt_solver.cpp:1890
smt_astt convert_modulus(const modulus2t &m, smt_astt a, smt_astt b)
Encode a remainder: compositional via the matching division when one exists in the formula,...
Definition smt_solver.cpp:1854
virtual smt_astt mk_shl(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4615
virtual smt_astt convert_array_store(const expr2tc &expr)
Partner method to convert_array_index, for stores.
Definition smt_solver.cpp:3200
smt_astt int_shift_op_array
Definition smt_solver.h:1250
std::set< size_t > step_sources
Definition smt_solver.h:1187
expr2tc decompose_select_chain(const expr2tc &expr, expr2tc &base)
When dealing with multi-dimensional arrays, and selecting one element out of several dimensions,...
Definition smt_solver.cpp:2821
smt_astt convert_typecast_to_fixedbv_nonint_from_bool(const expr2tc &cast)
Definition smt_casts.cpp:73
smt_astt convert_ptr_cmp(const expr2tc &expr, const expr2tc &expr2, const expr2tc &templ_expr)
Compare two pointers.
Definition smt_memspace.cpp:34
const namespacet & ns
A namespace containing all the types in the program.
Definition smt_solver.h:1128
virtual smt_sortt mk_bvfp_sort(std::size_t ew, std::size_t sw)
Create a floating-point sort, using bitvectors.
Definition smt_solver.cpp:4496
smt_astt convert_assign(const expr2tc &expr)
Definition smt_solver.cpp:388
virtual BigInt get_bv(smt_astt a, bool is_signed)=0
Extract the assignment to a bitvector from the SMT solver's model.
virtual smt_astt mk_add(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4531
std::map< std::string, unsigned int > fresh_map
Mapping of name prefixes to use counts: when we want a fresh new name with a particular prefix,...
Definition smt_solver.h:1210
smt_astt mk_bvredand(smt_astt op)
Reduction and: equals bit1 iff all bits are 1.
Definition smt_solver.cpp:4520
fp_convt * fp_api
Definition smt_solver.h:1244
std::list< std::map< unsigned, bool > > addr_space_data
The objects given an address so far, each mapped to whether it is a heap object that may be freed.
Definition smt_solver.h:1224
smt_astt convert_typecast_to_ints_intmode(const typecast2t &cast)
Definition smt_casts.cpp:227
std::string get_cur_addrspace_ident()
Get the symbol name for the current address-allocation record array.
Definition smt_memspace.cpp:760
virtual smt_astt mk_eq(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4805
smt_astt convert_typecast_to_bool(const typecast2t &cast)
Typecast data to bools.
Definition smt_casts.cpp:8
smt_astt convert_typecast_to_fixedbv_nonint_from_bv(const expr2tc &cast)
Definition smt_casts.cpp:36
virtual smt_astt mk_and(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4703
void record_flattened_pointer(smt_astt address, smt_astt pointer)
Definition smt_bitcast.cpp:231
array_iface * array_api
Definition smt_solver.h:1243
void finalize_pointer_chain(unsigned int obj_num)
Create and assert address space constraints on the given object ID number.
Definition smt_memspace.cpp:537
virtual smt_astt mk_bvsge(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4797
std::vector< ptr_flatten_entry > ptr_flatten_history
Every flattened pointer in this context.
Definition smt_solver.h:1174
virtual smt_astt mk_lt(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4716
smt_astt get_single_min_subnormal()
Definition smt_fp_conv.cpp:507
virtual smt_astt mk_bvadd(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4538
virtual smt_astt mk_isint(smt_astt a)
Definition smt_solver.cpp:4882
smt_astt convert_byte_extract_bv_mode(const byte_extract2t &data, expr2tc source, expr2tc offs, unsigned int src_width)
Definition smt_byteops.cpp:132
virtual smt_astt mk_bvsdiv(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4601
std::unordered_map< std::string, std::vector< uf_ackermann_entry > > uf_ackermann_history
Per-name history of uninterpreted-function applications, used only by the Ackermannisation fallback i...
Definition smt_solver.h:1156
smt_astt convert_byte_update_bv_mode(const byte_update2t &data)
Convert a byte_update2tc using bitvector operations, preserving the original bitvector-based implemen...
Definition smt_byteops.cpp:429
virtual smt_astt mk_bvudiv(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4608
smt_astt convert_byte_update_int_mode(const byte_update2t &data)
Convert a byte_update2tc in integer arithmetic mode, handling both constant and non-constant offsets ...
Definition smt_byteops.cpp:287
void rewrite_ptrs_to_structs(type2tc &type)
For the given type, replace all instances of a pointer type with the struct representation of it.
Definition smt_solver.cpp:4271
void dump_expr(const expr2tc &expr)
Convert expr and dump the resulting SMT AST in SMT format.
Definition smt_solver.cpp:4404
smt_astt make_bool_bit(smt_astt a)
Convert a boolean to a bitvector with one bit.
Definition smt_solver.cpp:2602
smt_astt convert_bitcast_to_struct(const expr2tc &from, const type2tc &to_type)
Rebuild a struct from the bits of from, member by member.
Definition smt_bitcast.cpp:496
smt_astt convert_is_nan(const expr2tc &expr)
Checks for equality with NaN representation.
Definition smt_fp_conv.cpp:642
std::string step_assigned
Definition smt_solver.h:1189
virtual smt_astt overflow_arith(const expr2tc &expr)
Detect integer arithmetic overflows.
Definition smt_overflow.cpp:10
std::unordered_map< smt_astt, std::pair< type2tc, expr2tc > > get_ast_cache
Model-value cache for get_by_ast(), on the same terms and with the same invalidation as l_get_cache.
Definition smt_solver.h:1108
smt_astt convert_bitcast_to_fp(const expr2tc &from, const type2tc &to_type)
Read a floating-point value from the bits of from.
Definition smt_bitcast.cpp:464
smt_astt get_double_inf_sentinel()
Definition smt_fp_conv.cpp:594
virtual smt_astt mk_bvumod(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4587
smt_astt convert_typecast_from_fpbv(const typecast2t &cast)
Typecast from a floatbv.
Definition smt_casts.cpp:185
smt_astt get_single_max_normal()
Definition smt_fp_conv.cpp:513
std::set< size_t > step_flattens
Definition smt_solver.h:1188
std::list< unsigned int > addr_space_sym_num
Integer recording how many times the address space allocation record array has been modified.
Definition smt_solver.h:1216
virtual ~smt_solver_baset()
virtual smt_astt mk_bvsgt(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4752
smt_astt convert_ast(const expr2tc &expr, const type2tc &type, smt_astt const *args, struct expr_op_convert ops)
Interface to specifig SMT conversion.
std::unordered_map< smt_astt, tvt > l_get_cache
Model-value cache for l_get().
Definition smt_solver.h:1101
expr2tc convert_byte_update_int_mode_expr(const byte_update2t &data, expr2tc source, expr2tc offs, expr2tc update_value, unsigned int src_width)
Convert a byte_update2tc with offset in integer mode, using conditional expressions for all possible ...
Definition smt_byteops.cpp:332
smt_astt convert_ast_node(const expr2tc &expr)
Convert a single node, assuming its operands are already in the cache.
Definition smt_solver.cpp:602
virtual void print_model()
Method to print the SMT model.
Definition smt_solver.cpp:4376
virtual smt_astt mk_gt(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4737
virtual smt_astt mk_bvuge(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4789
smt_astt convert_concat_int_mode(smt_astt left_ast, smt_astt right_ast, const expr2tc &expr)
Definition smt_solver.cpp:314
smt_astt convert_is_finite(const expr2tc &expr)
Checks for equality with finite representation.
Definition smt_fp_conv.cpp:780
virtual smt_astt mk_neg(smt_astt a)
Definition smt_solver.cpp:4643
smt_sortt mk_real_fp_sort(std::size_t ew, std::size_t sw)
Create an real or floating-point/fixed-point sort.
Definition smt_solver.h:461
void bump_addrspace_array(unsigned int idx, const expr2tc &val)
Definition smt_memspace.cpp:742
smt_sort_cachet sort_cache
A cache of converted type2tc's to smt sorts.
Definition smt_solver.h:1094
void renumber_symbol_address(const expr2tc &guard, const expr2tc &addr_symbol, const expr2tc &new_size)
Definition smt_memspace.cpp:275
smt_astt convert_rounding_mode(const expr2tc &expr)
Converts rounding mode for ieee fp operations.
Definition smt_fp_conv.cpp:868
smt_astt convert_pointer_bitcast(const expr2tc &from, const type2tc &to_type)
The pointer, floating-point and struct legs of convert_bitcast, split out so the dispatcher stays rea...
Definition smt_bitcast.cpp:445
virtual bool supports_assumptions() const
Definition smt_solver.h:298
virtual smt_astt overflow_cast(const expr2tc &expr)
Detect integer overflows in a cast.
Definition smt_overflow.cpp:309
void set_ra_conv(ra_apit *iface)
Stores handle for the real-arithmetic/enclosure interface.
Definition smt_solver.cpp:151
void init_addr_space_array()
Initialize tracking data for the address space records.
Definition smt_memspace.cpp:675
smt_astt imply_ast(smt_astt a, smt_astt b)
Create an ipmlication between two smt_ast's.
Definition smt_solver.cpp:308
std::optional< expr2tc > get_index_value(const expr2tc &expr, expr2tc &res)
Fetch a satisfying assignment from the solver.
Definition smt_solver.cpp:3395
smt_astt get_zero_real()
Definition smt_fp_conv.cpp:13
virtual tvt l_get(smt_astt a)
Fetch the value of a boolean sorted smt_ast.
Definition smt_solver.cpp:4382
virtual smt_astt mk_bvshl(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4622
virtual smt_astt mk_sign_ext(smt_astt a, unsigned int topwidth)=0
Given a signed, upwards cast, extends the sign of the given AST to the desired length.
virtual smt_astt mk_zero_ext(smt_astt a, unsigned int topwidth)=0
Identical to mk_sign_ext, but extends AST with zeros.
virtual smt_astt mk_real2int(smt_astt a)
Definition smt_solver.cpp:4870
smt_astt convert_typecast_to_ints(const typecast2t &cast)
Typecast anything to an integer (but not pointers).
Definition smt_casts.cpp:205
void set_fp_conv(fp_convt *iface)
Stores handle for the floating-point interface.
Definition smt_solver.cpp:145
virtual smt_astt mk_bvor(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4668
virtual smt_astt mk_int2real(smt_astt a)
Definition smt_solver.cpp:4876
void expand_row_stores(const expr2tc &row, const expr2tc &offset, std::vector< flat_storet > &stores)
Name every element of a row being written whole as a store of the corresponding read out of it,...
Definition smt_solver.cpp:3042
std::unordered_map< type2tc, smt_sortt, type2_hash > smt_sort_cachet
Definition smt_solver.h:1083
smt_astt null_ptr_ast
Definition smt_solver.h:1134
smt_sortt mk_int_bv_sort(std::size_t width)
Create an integer or SBV/UBV sort.
Definition smt_solver.h:449
smt_astt convert_bitcast(const expr2tc &expr)
Convert a bitcast2tc, converting an expr to its bit representation.
Definition smt_bitcast.cpp:628
bool decompose_stores(const expr2tc &expr, const expr2tc &offset, std::vector< flat_storet > &stores, expr2tc &base)
Decompose an array with into the flat element updates it denotes, oldest first, giving back the array...
Definition smt_solver.cpp:3077
smt_astt new_solver_ast(typename the_solver_ast::solver_ast_type ast, smt_sortt sort)
Definition smt_solver.h:177
smt_astt convert_typecast_to_ints_from_bool(const typecast2t &cast)
Definition smt_casts.cpp:340
virtual void push_ctx()
Push one context on the SMT assertion stack.
Definition smt_solver.cpp:190
smt_astt array_create(const expr2tc &expr)
Convert constant_array2tc's and constant_array_of2tc's.
Definition smt_solver.cpp:4033
virtual smt_astt apply_ieee754_semantics(smt_astt real_result, const floatbv_type2t &fbv_type, smt_astt operand_zero_check=nullptr, const expr2tc &rounding_mode=expr2tc())
Applies IEEE 754 floating-point semantics to a real arithmetic result.
Definition smt_fp_conv.cpp:32
smt_astt divide_by_element_size(const expr2tc &diff, const expr2tc &size)
The quotient of a signed byte difference by an element size, truncated toward zero.
Definition smt_memspace.cpp:104
std::map< std::string, smt_astt > renumber_mapt
Definition smt_solver.h:1231
std::list< pointer_logict > pointer_logic
Pointer_logict object, which contains some code for formatting how pointers are displayed in counter-...
Definition smt_solver.h:1112
smt_astt convert_typecast_to_struct(const typecast2t &cast)
Typecast structs to other structs.
Definition smt_casts.cpp:604
std::unordered_map< irep_idt, expr2tc, irep_id_hash > forall_defs_
Map from SSA symbol name to its forall/exists irep2 expression.
Definition smt_solver.h:1204
smt_astt convert_is_normal(const expr2tc &expr)
Checks for equality with normal representation.
Definition smt_fp_conv.cpp:733
expr2tc array_domain_to_width(const type2tc &type)
Fetch the number of elements in an array (the domain).
Definition smt_solver.cpp:2746
type2tc get_flattened_array_subtype(const type2tc &type)
Get the base subtype of an array, delving through any intermediate multidimensional arrays.
Definition smt_solver.cpp:3336
void delete_all_asts()
Definition smt_solver.cpp:157
virtual smt_astt mk_concat(smt_astt a, smt_astt b)=0
Concatenate two smt expressions.
std::vector< renumber_mapt > renumber_map
Definition smt_solver.h:1232
smt_astt get_single_eps_up()
Definition smt_fp_conv.cpp:634
smt_astt mk_truncated_rem(const type2tc &type, smt_astt a, smt_astt b)
Definition smt_solver.cpp:1898
virtual void pop_ctx()
Pop one context on the SMT assertion stack.
Definition smt_solver.cpp:250
std::unique_ptr< ir_ieee_convt > ir_ieee_api
Definition smt_solver.h:1246
smt_astt get_single_eps_rel()
Definition smt_fp_conv.cpp:619
virtual smt_astt mk_bvugt(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4744
std::vector< smt_astt > ast_vec
Shorthand for a vector of smt_ast's.
Definition smt_solver.h:173
void begin_step(const expr2tc &guard, const expr2tc &cond)
Definition smt_bitcast.cpp:251
smt_astt convert_ast(const expr2tc &expr)
Main interface to SMT conversion.
Definition smt_solver.cpp:475
expr2tc current_valid_objects_sym
Holds the __ESBMC_alloc symbol convert_terminal() was last invoked with.
Definition smt_solver.h:1228
void assert_expr(const expr2tc &e)
Convert the given expr to AST, then assert that AST.
Definition smt_solver.cpp:1922
smt_astt pointer_array_of(const expr2tc &init_val, unsigned long array_width)
Create an array of pointers; expects the init_val to be null, because there's no other way to initial...
Definition smt_solver.cpp:4210
smt_astt get_single_inf_sentinel()
Definition smt_fp_conv.cpp:603
expr2tc get_array(const type2tc &type, smt_astt array)
Given an array expression, attempt to extract its valuation from the solver model,...
Definition smt_solver.cpp:3978
smt_astt convert_byte_extract_int_mode(const byte_extract2t &data, expr2tc source, expr2tc offs, unsigned int src_width)
Definition smt_byteops.cpp:29
smt_astt make_n_ary_or(const ast_vec &v)
Definition smt_solver.cpp:2651
virtual smt_sortt mk_bvfp_rm_sort()
Create a floating-point rounding mode sort, using bitvectors.
Definition smt_solver.cpp:4502
std::vector< unsigned int > live_asts_sizes
Accounting of live_asts for push/pop.
Definition smt_solver.h:1240
smt_astt convert_array_of_prep(const expr2tc &expr)
Prepare an array_of expression by flattening its dimensions, if it has more than one.
Definition smt_solver.cpp:4116
virtual smt_astt mk_smt_int(const BigInt &theint)=0
Create an integer smt_ast.
virtual std::string dump_smt()
Method to dump the SMT formula.
Definition smt_solver.cpp:4370
type2tc pointer_struct
Constant struct representing the implementation of the pointer type – i.e., the struct type that poin...
Definition smt_solver.h:1115
smt_astt get_double_eps_up()
Definition smt_fp_conv.cpp:626
virtual smt_sortt mk_fbv_sort(std::size_t width)
Create a fixed-point sort.
Definition smt_solver.cpp:4484
smt_astt convert_typecast(const expr2tc &expr)
Despatch a typecast expression to a more specific typecast method.
Definition smt_casts.cpp:699
virtual smt_astt mk_quantifier(bool is_forall, std::vector< smt_astt > lhs, smt_astt rhs)
Definition smt_solver.h:435
virtual smt_astt mk_ite(smt_astt cond, smt_astt t, smt_astt f)=0
Create an ite operation.
virtual smt_astt mk_bvashr(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4629
bool int_encoding
Whether we are encoding expressions in integer mode or not.
Definition smt_solver.h:1121
virtual smt_astt mk_smt_symbol(const std::string &name, smt_sortt s)=0
Create a symbol / variable.
virtual bool get_rational(smt_astt a, BigInt &numerator, BigInt &denominator)
Extract the assignment to a rational/real value from the SMT solvers model.
Definition smt_solver.h:340
virtual smt_astt mk_implies(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4682
virtual smt_astt mk_smt_uninterpreted_function(const std::string &name, const std::vector< smt_astt > &args, smt_sortt rangesort)
Apply an uninterpreted function.
Definition smt_solver.cpp:4817
smt_astt convert_member(const expr2tc &expr)
Handle union/struct based corner cases for member2tc expressions.
Definition smt_solver.cpp:2397
virtual smt_astt mk_div(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4594
std::unordered_map< expr2tc, ptr_flatten_entry, irep2_hash > flattened
Each flattening bitcast converted so far, for steps that hit it in the conversion cache.
Definition smt_solver.h:1180
virtual smt_astt mk_select(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4863
smt_astt convert_typecast_from_ptr(const typecast2t &cast)
Typecast a pointer to an integer.
Definition smt_casts.cpp:551
void note_division_operands(const expr2tc &expr, std::unordered_set< const expr2t * > &seen)
Record every division's operand pair in expr, recursively.
Definition smt_solver.cpp:1905
virtual smt_astt mk_bvand(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4675
smt_astt convert_pointer_arith(const expr2tc &expr, const type2tc &t)
Flatten pointer arithmetic.
Definition smt_memspace.cpp:130
smt_astt get_double_min_subnormal()
Definition smt_fp_conv.cpp:25
virtual smt_resultt dec_solve()=0
Solve the formula given to the solver.
virtual smt_astt overflow_neg(const expr2tc &expr)
Detects integer overflows in negation.
Definition smt_overflow.cpp:355
virtual smt_astt mk_le(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4760
bool pointer_repr_applies(const type2tc &ptr_type, const type2tc &bv_type)
True when ptr_type's representation occupies bv_type exactly, so the bits read back are the bits that...
Definition smt_bitcast.cpp:201
type2tc addr_space_arr_type
Type of the array of address space allocation records.
Definition smt_solver.h:1221
size_t quantifier_counter
Counter for generating unique bound-variable names in quantifiers.
Definition smt_solver.h:1138
virtual void assert_ast(smt_astt a)=0
Assert the truth of an ast.
smt_astt round_fixedbv_to_int(smt_astt a, unsigned int width, unsigned int towidth)
Round a fixedbv to an integer.
Definition smt_solver.cpp:2562
smt_astt encode_pointer_repr(const expr2tc &ptr, const type2tc &to_type)
Flatten a pointer to the machine representation a bitcast reinterprets, and rebuild it from one; see ...
Definition smt_bitcast.cpp:214
virtual smt_astt mk_bvslt(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4730
virtual smt_astt mk_or(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4696
bool ir_ieee
Whether –ir-ieee mode is active (integer encoding with IEEE float semantics).
Definition smt_solver.h:1124
smt_astt convert_addr_of(const expr2tc &expr)
Take the address of some kind of expression.
Definition smt_memspace.cpp:591
smt_astt convert_signbit(const expr2tc &expr)
Converts signbit representation.
Definition smt_fp_conv.cpp:824
smt_astt convert_terminal(const expr2tc &expr)
Convert a terminal expression into an SMT AST.
Definition smt_solver.cpp:2083
virtual smt_astt mk_bvmul(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4566
smt_astt convert_typecast_to_ptr(const typecast2t &cast)
Typecast something (i.e.
Definition smt_casts.cpp:408
virtual smt_astt mk_bvsle(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4774
std::vector< smt_astt > live_asts
Lifetime tracking of smt ast's.
Definition smt_solver.h:1236
smt_astt convert_typecast_to_fixedbv_nonint(const expr2tc &cast)
Typecast to a fixedbv in bitvector mode.
Definition smt_casts.cpp:15
virtual smt_astt mk_store(smt_astt a, smt_astt b, smt_astt c)
Definition smt_solver.cpp:4855
virtual smt_astt mk_mod(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4573
smt_astt convert_ieee_arith_2op(const expr2tc &expr)
Convert one of the two-operand IEEE arithmetic nodes (add/sub/mul/div/ rem), which share an operand l...
Definition smt_solver.cpp:555
virtual smt_sortt mk_bv_sort(std::size_t width)
Create a bv sort.
Definition smt_solver.cpp:4478
expr2tc get_by_value(const type2tc &type, BigInt value)
Builds the bitvector based on the value retrieved from the solver.
Definition smt_solver.cpp:4414
virtual smt_astt mk_bvneg(smt_astt a)
Definition smt_solver.cpp:4649
smt_sortt boolean_sort
Sort for booleans.
Definition smt_solver.h:1119
std::mutex smt_cache_mutex
A mutex lock for writing to the cache.
Definition smt_solver.h:1092
smt_cachet smt_cache
A cache mapping expressions to converted SMT ASTs.
Definition smt_solver.h:1090
smt_astt convert_typecast_to_fixedbv_nonint_from_fixedbv(const expr2tc &cast)
Definition smt_casts.cpp:91
void smt_post_init()
Post-constructor setup method.
Definition smt_solver.cpp:165
virtual smt_astt mk_xor(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4689
smt_astt mk_subnormal_flush(smt_astt r, const floatbv_type2t &fbv_type, const expr2tc &rounding_mode)
Definition smt_fp_conv.cpp:521
virtual smt_astt mk_sub(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4545
virtual smt_astt mk_bvlshr(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4636
virtual smt_astt mk_bvule(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4767
size_t flatten_count
Definition smt_solver.h:1191
smt_astt mk_bvredor(smt_astt op)
Reduction or: equals bit0 iff all bits are 0.
Definition smt_solver.cpp:4508
void end_step()
Definition smt_bitcast.cpp:294
smt_astt convert_byte_extract(const expr2tc &expr)
Convert a byte_extract2tc, pulling a byte from the byte representation of some piece of data.
Definition smt_byteops.cpp:4
void note_assignment(const expr2tc &lhs, const expr2tc &rhs)
Definition smt_bitcast.cpp:286
smt_astt get_single_min_normal()
Definition smt_fp_conv.cpp:501
boost::multi_index_container< smt_cache_entryt, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< BOOST_MULTI_INDEX_MEMBER(smt_cache_entryt, const expr2tc, val)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(smt_cache_entryt, unsigned int, level), std::greater< unsigned int > > > > smt_cachet
Definition smt_solver.h:1081
virtual smt_astt convert_array_index(const expr2tc &expr)
High level index expression conversion.
Definition smt_solver.cpp:3148
size_t uf_ackermann_counter
Counter for the fresh result symbols minted by the Ackermann fallback.
Definition smt_solver.h:1158
smt_astt init_pointer_obj(unsigned int obj_num, const expr2tc &size, const typet *type, bool may_be_freed)
Definition smt_memspace.cpp:403
virtual smt_astt mk_bvnot(smt_astt a)
Definition smt_solver.cpp:4655
virtual bool has_model() const
Whether a satisfiable result can be turned into a model.
Definition smt_solver.h:211
smt_astt convert_popcount(const expr2tc &expr)
Converts popcount representation.
Definition smt_solver.cpp:2317
void set_tuple_iface(tuple_iface *iface)
Stores handle for the tuple interface.
Definition smt_solver.cpp:133
virtual smt_astt mk_neq(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4812
unsigned int ctx_level
Number of un-popped context pushes encountered so far.
Definition smt_solver.h:1087
virtual smt_astt mk_bvsub(smt_astt a, smt_astt b)
Definition smt_solver.cpp:4552
smt_astt convert_is_inf(const expr2tc &expr)
Checks for equality with inf representation.
Definition smt_fp_conv.cpp:694
type2tc flatten_array_type(const type2tc &type)
For a multi-dimensional array, convert the type into a single dimension array.
Definition smt_solver.cpp:3265
std::set< std::pair< expr2tc, expr2tc > > divided_operand_pairs
Operand pairs of every division seen by note_division_operands.
Definition smt_solver.h:937
smt_astt convert_byte_update(const expr2tc &expr)
Convert a byte_update2tc, inserting a byte into the byte representation of some piece of data.
Definition smt_byteops.cpp:249
virtual smt_sortt mk_real_sort()
Create a real sort.
Definition smt_solver.cpp:4466
smt_astt get_double_max_normal()
Definition smt_fp_conv.cpp:493
virtual const std::string solver_text()=0
Solver name fetcher.
Definition smt_tuple.h:27
Definition threeval.h:10
Typecast expression.
Definition irep2_expr.h:729
Definition type.h:9
Definition toml.hpp:1531
configt config
Definition config.cpp:8
pthread_cond_t cond
Definition cuda.h:50
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
Definition range.py:1
Definition exception.cpp:51
const smt_ast * smt_astt
Definition smt_ast.h:30
smt_resultt
Result of a call to dec_solve.
Definition smt_result.h:7
expr2tc union_bits_of_member(const expr2tc &member, unsigned bits)
A union member's bits member widened to the union's bits, as the bits at the union's lowest address; ...
Definition smt_bitcast.cpp:87
unsigned long array_domain_width_or_word_size(const array_type2t &arr)
Return the SMT domain bit-width for an array type.
Definition smt_solver.cpp:2694
boost::multi_index_container< symtab_entryt, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< BOOST_MULTI_INDEX_MEMBER(symtab_entryt, std::string, val)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(symtab_entryt, unsigned int, level), std::greater< unsigned int > > > > symtabt
Definition smt_solver.h:1299
expr2tc byte_update_bit_offset(const byte_update2t &data)
The bit a byte update with a symbolic offset writes at, in bit-vector mode: the offset scaled to bits...
Definition smt_byteops.cpp:415
bool lowest_address_high()
Whether an object's lowest address sits in the most significant bits of its bit-vector encoding: true...
Definition smt_bitcast.cpp:50
type2tc make_array_domain_type(const array_type2t &arr)
Given an array type, create a type2tc representing its domain.
Definition smt_solver.cpp:2713
expr2tc union_member_bits(const expr2tc &bits, unsigned width)
The width bits of a union member within the union's bits bits: those at the union's lowest address.
Definition smt_bitcast.cpp:61
expr2tc union_bits_with_member(const expr2tc &rest, const expr2tc &member, unsigned bits)
The bits wide bits of a union whose lowest-addressed bits hold member and whose other bits are those ...
Definition smt_bitcast.cpp:69
unsigned flattened_position(unsigned offset, unsigned width, unsigned total)
Lowest bit of the width bits at bit offset offset of a total bit object's bit-vector encoding.
Definition smt_bitcast.cpp:55
const smt_sort * smt_sortt
Definition smt_sort.h:37
void abort(void)
Definition stdlib.c:77
One element update an array with denotes, as an index into the array's flattened form and the value s...
Definition smt_solver.h:1017
expr2tc value
Definition smt_solver.h:1019
expr2tc index
Definition smt_solver.h:1018
One pointer flattened to its machine representation by a bitcast.
Definition smt_solver.h:1163
size_t id
Definition smt_solver.h:1170
unsigned int level
Definition smt_solver.h:1169
smt_astt guard
The flattening step's guard: an unexecuted step can flatten any pointer.
Definition smt_solver.h:1168
smt_astt address
Definition smt_solver.h:1164
smt_astt pointer
Definition smt_solver.h:1165
Definition smt_solver.h:1067
smt_astt ast
Definition smt_solver.h:1069
unsigned int level
Definition smt_solver.h:1070
const expr2tc val
Definition smt_solver.h:1068
One recorded uninterpreted-function application in the Ackermannisation fallback: the argument asts,...
Definition smt_solver.h:1145
std::vector< smt_astt > args
Definition smt_solver.h:1146
smt_astt result
Definition smt_solver.h:1147
unsigned int level
Definition smt_solver.h:1148
Definition smt_solver.h:1280
std::string val
Definition smt_solver.h:1281
smt_astt ast
Definition smt_solver.h:1282
symtab_entryt(std::string val, smt_astt ast, unsigned int level)
Definition smt_solver.h:1285
unsigned int level
Definition smt_solver.h:1283