ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
value_set.h
Go to the documentation of this file.
1#ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_H
2#define CPROVER_POINTER_ANALYSIS_VALUE_SET_H
3
4#include <tuple>
5#include <map>
7#include <optional>
8#include <set>
9#include <irep2/irep2.h>
10#include <util/arith/mp_arith.h>
12#include <util/base/numbering.h>
14#include <util/persistent_map.h>
15
49
50/* Index of, and bytes spanned by, the leading component of a value-set suffix
51 * `rest` (with its '.' already dropped) among the member @p names. Member
52 * names are not identifiers -- clang spells an anonymous member
53 * "S::(anonymous at f.c:4:9)", which contains '.' -- so the component is the
54 * longest declared name `rest` continues on a component boundary, never
55 * whatever precedes the next '.' or '['. */
56std::optional<std::pair<size_t, size_t>> match_leading_component(
57 const std::vector<irep_idt> &names,
58 const std::string &rest);
59
62
64{
65public:
67 explicit value_sett(const namespacet &_ns)
68 : location_number(0),
69 ns(_ns),
70 xchg_name("value_sett::__ESBMC_xchg_ptr"),
71 xchg_num(0)
72 {
73 }
74
75 /* rec_cache is deliberately not copied: it points into the stack frame of an
76 * in-progress query, and a copy can only be taken between queries. */
79 values(ref.values),
80 ns(ref.ns),
81 xchg_name("value_sett::__ESBMC_xchg_ptr"),
82 xchg_num(0)
83 {
84 }
85
87 {
89 values = ref.values;
90 xchg_name = ref.xchg_name;
91 xchg_num = ref.xchg_num;
92 // No need to copy ns, it should be the same in all contexts.
93 return *this;
94 }
95
96 //*********************************** Types
97 //************************************
98
100 typedef std::set<expr2tc> expr_sett;
101
113 {
114 public:
118
119 objectt(bool offset_set, unsigned int operand)
120 {
121 if (offset_set)
122 {
123 offset_is_set = true;
124 offset = BigInt(operand);
126 }
127 else
128 {
129 offset_is_set = false;
130 offset_alignment = operand;
131 assert(offset_alignment != 0);
132 }
133 }
134
135 explicit objectt(bool offset_set [[maybe_unused]], const BigInt &_offset)
136 : offset(_offset), offset_is_set(true)
137 {
138 assert(offset_set);
140 }
141
155 unsigned int offset_alignment;
156 bool offset_is_zero() const
157 {
158 return offset_is_set && offset.is_zero();
159 }
160 bool operator==(const objectt &o) const
161 {
162 return offset_is_set == o.offset_is_set &&
164 (!offset_is_set || offset == o.offset);
165 }
166 bool operator!=(const objectt &o) const
167 {
168 return !(*this == o);
169 }
170 };
171
176 typedef std::unordered_map<unsigned, objectt> object_mapt;
178 {
179 // If you said this class looks pretty map like, it's because it used to be
180 // a subclass of std::map, which was far too funky for me, thanks.
181 public:
183 {
184 for (auto const &it : themap)
186 }
187
189 {
190 }
191
193
195 {
196 *this = ref;
197 for (auto const &it : themap)
199 }
200 typedef object_mapt::const_iterator const_iterator;
201 typedef object_mapt::iterator iterator;
202
203 objectt &operator[](unsigned i)
204 {
205 if (themap.find(i) == themap.end())
207 return themap[i];
208 }
209
210 const_iterator find(unsigned i) const
211 {
212 return themap.find(i);
213 }
214
215 iterator find(unsigned i)
216 {
217 return themap.find(i);
218 }
219
221 {
222 return themap.begin();
223 }
224
226 {
227 return themap.end();
228 }
229
230 std::size_t size(void) const
231 {
232 return themap.size();
233 }
234
236 };
237
246 struct entryt
247 {
253 std::string identifier;
261 std::string suffix;
262
263 entryt() = default;
264
265 entryt(std::string _identifier, const std::string &_suffix)
266 : identifier(std::move(_identifier)), suffix(_suffix)
267 {
268 }
269
270 /* Value equality so the persistent map can be structurally diffed
271 * (immer::diff). Only invoked on entries the diff cannot skip by
272 * pointer identity, i.e. the divergent leaves. */
273 bool operator==(const entryt &e) const
274 {
275 return identifier == e.identifier && suffix == e.suffix &&
276 object_map == e.object_map;
277 }
278 bool operator!=(const entryt &e) const
279 {
280 return !(*this == e);
281 }
282 };
283
291
302 inline unsigned int get_natural_alignment(const expr2tc &e) const
303 {
304 const type2tc &t = e->type;
305
306 // Null objects are allowed to have symbol types. What alignment to give?
307 // Pick 8 bytes, as that's a) word aligned, b) double/uint64_t aligned.
308 if (is_null_object2t(e))
309 return 8;
310
311 assert(!is_symbol_type(t));
312 if (is_array_type(t))
313 {
314 const array_type2t &arr = to_array_type(t);
316 }
317
318 return 8;
319 }
320
321 inline unsigned int offset2align(const expr2tc &e, const BigInt &m) const
322 {
323 unsigned int nat_align = get_natural_alignment(e);
324 if (m == 0)
325 {
326 return nat_align;
327 }
328 if ((m % nat_align) == 0)
329 {
330 return nat_align;
331 }
332
333 // What's the least alignment available?
334 unsigned int max_align = 8;
335 do
336 {
337 // Repeatedly decrease the word size by powers of two, and test to see
338 // whether the offset meets that alignment. This will always succeed
339 // and exit the loop when the alignment reaches 1.
340 if ((m % max_align) == 0)
341 return max_align;
342 max_align /= 2;
343 } while (true);
344 }
345
348 expr2tc to_expr(object_mapt::const_iterator it) const;
349
353 void set(object_mapt &dest, object_mapt::const_iterator it) const
354 {
355 // Fetch/insert iterator
356 std::pair<object_mapt::iterator, bool> res =
357 dest.insert(object_mapt::value_type(it->first, it->second));
358
359 // An entry already present for this object number is left untouched:
360 // the assignment below runs only for freshly inserted elements, where
361 // it is a no-op.
362 if (res.second)
363 res.first->second = it->second;
364 }
365
366 bool insert(object_mapt &dest, object_mapt::const_iterator it) const
367 {
368 return insert(dest, it->first, it->second);
369 }
370
371 bool insert(object_mapt &dest, const expr2tc &src, const BigInt &offset) const
372 {
373 return insert(dest, object_numbering.number(src), objectt(true, offset));
374 }
375
393 bool insert(object_mapt &dest, unsigned n, const objectt &object) const
394 {
395 object_mapt::const_iterator it = dest.find(n);
396 if (it == dest.end())
397 {
398 // new
399 dest.insert(object_mapt::value_type(n, object));
400 return true;
401 }
402
403 object_mapt::iterator it2 = dest.find(n);
404 objectt &old = it2->second;
405 const expr2tc &expr_obj = object_numbering[n];
406
407 if (old.offset_is_set && object.offset_is_set)
408 {
409 if (old.offset == object.offset)
410 return false;
411
412 // Merge the tracking for two offsets; take the minimum alignment
413 // guaranteed by them.
414 unsigned long old_align = offset2align(expr_obj, old.offset);
415 unsigned long new_align = offset2align(expr_obj, object.offset);
416 old.offset_is_set = false;
417 old.offset_alignment = std::min(old_align, new_align);
418 return true;
419 }
420
421 if (!old.offset_is_set)
422 {
423 unsigned int oldalign = old.offset_alignment;
424 if (!object.offset_is_set)
425 {
426 // Both object offsets not set; update alignment to minimum of the two
427 old.offset_alignment =
428 std::min(old.offset_alignment, object.offset_alignment);
429 return !(old.offset_alignment == oldalign);
430 }
431
432 // Old offset unset; new offset set. Compute the alignment of the
433 // new object's offset, and take the minimum of that and the old
434 // alignment.
435 unsigned int new_alignment = offset2align(expr_obj, object.offset);
436 old.offset_alignment = std::min(old.offset_alignment, new_alignment);
437 return !(old.offset_alignment == oldalign);
438 }
439
440 // Old offset alignment is set; new isn't.
441 unsigned int old_align = offset2align(expr_obj, old.offset);
442 old.offset_alignment = std::min(old_align, object.offset_alignment);
443 old.offset_is_set = false;
444 return true;
445 }
446
447 bool
448 insert(object_mapt &dest, const expr2tc &expr, const objectt &object) const
449 {
450 return insert(dest, object_numbering.number(expr), object);
451 }
452
456 bool erase(const std::string &name)
457 {
458 return values.erase(name);
459 }
460
465 void erase_object(
466 const std::string &id,
467 const type2tc &type,
468 const std::string &suffix = "");
469
490 void get_value_set(const expr2tc &expr, value_setst::valuest &dest) const;
491
493 void clear()
494 {
495 values.clear();
496 }
497
500 void add_var(const std::string &id, const std::string &suffix)
501 {
502 touch_entry(entryt(id, suffix));
503 }
504
505 void add_var(const entryt &e)
506 {
507 touch_entry(e);
508 }
509
511 void del_var(const std::string &id, const std::string &suffix)
512 {
513 if (suffix.empty())
514 {
515 values.erase(id);
516 return;
517 }
518 values.erase(concat_key(id, suffix));
519 }
520
525 static irep_idt entry_key(const entryt &e)
526 {
527 if (e.suffix.empty())
528 return e.identifier;
529 return concat_key(e.identifier, e.suffix);
530 }
531
535 void touch_entry(const entryt &e)
536 {
538 if (values.find(key) == nullptr)
539 values.set(key, e);
540 }
541
545 bool update_object_map(const entryt &e, const object_mapt &om, bool merge)
546 {
548 const entryt *cur = values.find(key);
549 if (cur == nullptr)
550 {
551 entryt fresh(e.identifier, e.suffix);
552 fresh.object_map = om;
553 values.set(key, std::move(fresh));
554 return true;
555 }
556 // Rebuild the record from its keys only — the old object_map is either
557 // superseded (overwrite) or unioned into a fresh copy (merge), so copying
558 // it off `cur` would be wasted.
559 entryt upd(cur->identifier, cur->suffix);
560 if (merge)
561 {
562 upd.object_map = cur->object_map;
563 if (!make_union(upd.object_map, om))
564 return false;
565 }
566 else
567 {
568 if (cur->object_map == om)
569 return false;
570 upd.object_map = om;
571 }
572 values.set(key, std::move(upd));
573 return true;
574 }
575
579 static std::string
580 concat_key(const std::string &id, const std::string &suffix)
581 {
582 std::string key;
583 key.reserve(id.size() + suffix.size());
584 key = id;
585 key += suffix;
586 return key;
587 }
588
590 void add_vars(const std::list<entryt> &vars)
591 {
592 for (const auto &var : vars)
593 add_var(var);
594 }
595
598 void output(std::ostream &out) const;
599
601 void dump() const;
602
608 bool make_union(object_mapt &dest, const object_mapt &src) const;
609
616 bool make_union(const valuest &new_values, bool keepnew = false);
617
618 bool make_union(const value_sett &new_values, bool keepnew = false)
619 {
620 return make_union(new_values.values, keepnew);
621 }
622
626 void apply_code(const expr2tc &code);
627
635 void assign(const expr2tc &lhs, const expr2tc &rhs, bool add_to_sets = false);
638 const expr2tc &lhs,
639 const expr2tc &rhs,
640 const type2tc &lhs_type,
641 bool add_to_sets);
642
650 void do_function_call(
651 const symbolt &symbol,
652 const std::vector<expr2tc> &arguments);
653
657 void do_end_function(const expr2tc &lhs);
658
672 void get_reference_set(const expr2tc &expr, value_setst::valuest &dest) const;
673
678 void get_value_set(const expr2tc &expr, object_mapt &dest) const;
679
705 object_mapt &op0_set,
706 object_mapt &op1_set,
707 object_mapt &dest) const;
708
715 const expr2tc &expr,
716 object_mapt &dest,
717 const std::string &suffix,
718 const type2tc &original_type,
719 bool under_deref = true) const;
720
721private:
727 using rec_cache_keyt =
728 std::tuple<const expr2t *, std::string, const type2t *, bool>;
729 using rec_cachet =
730 std::map<rec_cache_keyt, std::tuple<expr2tc, type2tc, object_mapt>>;
731
735 mutable rec_cachet *rec_cache = nullptr;
736
739 void get_value_set_rec(
740 const expr2tc &expr,
741 object_mapt &dest,
742 const std::string &suffix,
743 const type2tc &original_type,
744 bool under_deref) const;
745
746protected:
750 std::optional<BigInt> constant_pointer_arith_offset(
751 const expr2tc &non_ptr_op,
752 const type2tc &subtype,
753 bool subtracting) const;
754
759 const object_mapt &pointer_expr_set,
760 const expr2tc &ptr_op,
761 const std::optional<BigInt> &total_offs,
762 object_mapt &dest) const;
763
768 const symbol2t &sym,
769 const expr2tc &expr,
770 const std::string &suffix,
771 const type2tc &original_type,
772 object_mapt &dest) const;
773
777 const expr2tc &expr,
778 object_mapt &dest,
779 const std::string &suffix,
780 const type2tc &original_type,
781 bool under_deref) const;
782
787 const expr2tc &expr,
788 object_mapt &dest,
789 const std::string &suffix,
790 const type2tc &original_type,
791 bool under_deref) const;
792
794 const expr2tc &expr,
795 object_mapt &dest,
796 const std::string &suffix,
797 const type2tc &original_type) const;
798
799 // Like get_value_set_rec, but dedicated to walking through the ireps that
800 // are produced by pointer deref byte stitching
802 const expr2tc &expr,
803 object_mapt &dest,
804 const std::string &suffix,
805 const type2tc &original_type) const;
806
812 void get_reference_set(const expr2tc &expr, object_mapt &dest) const
813 {
814 get_reference_set_rec(expr, dest);
815 }
816
821 void get_reference_set_rec(const expr2tc &expr, object_mapt &dest) const;
822
832 void assign_rec(
833 const expr2tc &lhs,
834 const object_mapt &values_rhs,
835 const std::string &suffix,
836 bool add_to_sets);
837
842 void do_free(const expr2tc &op);
843
850 expr2tc make_member(const expr2tc &src, const irep_idt &component_name);
851
852 static void obj_numbering_ref(unsigned int num);
853 static void obj_numbering_deref(unsigned int num);
854
855public:
856 //********************************** Members
857 //***********************************
870
874
877
879 unsigned long xchg_num;
880};
881
882// Exceptions
883
887
888#endif
Definition bigint.hh:58
uint64_t to_uint64() const
Definition bigint.cpp:659
Array type.
Definition irep2_type.h:422
type2tc subtype
Definition irep2_type.h:504
Definition numbering.h:79
Definition irep_idt.h:12
Definition namespace.h:10
Persistent (structurally shared) map with O(1) copy.
Definition persistent_map.h:31
Symbol type.
Definition irep2_expr.h:625
Definition symbol.h:12
std::list< expr2tc > valuest
Definition value_sets.h:15
object_map_dt(const object_map_dt &ref)
Definition value_set.h:194
const_iterator end() const
Definition value_set.h:225
object_map_dt & operator=(const object_map_dt &other)=default
object_mapt::const_iterator const_iterator
Definition value_set.h:200
object_map_dt()
Definition value_set.h:188
iterator find(unsigned i)
Definition value_set.h:215
std::size_t size(void) const
Definition value_set.h:230
const_iterator find(unsigned i) const
Definition value_set.h:210
const_iterator begin() const
Definition value_set.h:220
object_mapt themap
Definition value_set.h:235
objectt & operator[](unsigned i)
Definition value_set.h:203
object_mapt::iterator iterator
Definition value_set.h:201
~object_map_dt()
Definition value_set.h:182
Record for an object reference.
Definition value_set.h:113
BigInt offset
Record of the explicit offset into the object.
Definition value_set.h:144
bool offset_is_set
Whether or not the offset field of this objectt is valid; if this is true, then the reference has a f...
Definition value_set.h:149
objectt(bool offset_set, unsigned int operand)
Definition value_set.h:119
objectt()
Definition value_set.h:115
objectt(bool offset_set, const BigInt &_offset)
Definition value_set.h:135
bool operator==(const objectt &o) const
Definition value_set.h:160
unsigned int offset_alignment
Least alignment of the offset.
Definition value_set.h:155
bool offset_is_zero() const
Definition value_set.h:156
bool operator!=(const objectt &o) const
Definition value_set.h:166
bool insert(object_mapt &dest, unsigned n, const objectt &object) const
Insert an object record into the given object map.
Definition value_set.h:393
void touch_entry(const entryt &e)
Ensure a record exists for the given entry, without changing an existing one.
Definition value_set.h:535
void get_value_set_rec_cached(const expr2tc &expr, object_mapt &dest, const std::string &suffix, const type2tc &original_type, bool under_deref=true) const
The entry point for the recursive value-set walk: memoises, then calls get_value_set_rec.
Definition value_set.cpp:597
expr2tc to_expr(object_mapt::const_iterator it) const
Convert an object map element to an expression.
Definition value_set.cpp:105
void get_constant_union_value_set(const expr2tc &expr, object_mapt &dest, const std::string &suffix, const type2tc &original_type) const
Definition value_set.cpp:406
void do_function_call(const symbolt &symbol, const std::vector< expr2tc > &arguments)
Interpret a function call during static analysis.
Definition value_set.cpp:1847
std::unordered_map< unsigned, objectt > object_mapt
Datatype for a value set: stores a mapping between some integers and additional reference data in an ...
Definition value_set.h:176
void assign_rec(const expr2tc &lhs, const object_mapt &values_rhs, const std::string &suffix, bool add_to_sets)
Recursive assign method implementation – descends through the left hand side looking for symbols to a...
Definition value_set.cpp:1734
std::set< expr2tc > expr_sett
A type for a set of expressions.
Definition value_set.h:100
persistent_map< irep_idt, entryt, irep_id_hash > valuest
Maps each variable to the entryt holding the set of objects it may point at.
Definition value_set.h:290
void do_free(const expr2tc &op)
Mark dynamic objects as (possibly) deallocated, and thus invalid.
Definition value_set.cpp:1660
void get_byte_stitching_value_set(const expr2tc &expr, object_mapt &dest, const std::string &suffix, const type2tc &original_type) const
Definition value_set.cpp:1111
void get_constant_struct_value_set(const expr2tc &expr, object_mapt &dest, const std::string &suffix, const type2tc &original_type, bool under_deref) const
The two aggregate literals of get_constant_value_set.
Definition value_set.cpp:373
bool get_symbol_value_set(const symbol2t &sym, const expr2tc &expr, const std::string &suffix, const type2tc &original_type, object_mapt &dest) const
What sym points at: the values keyed under the path the read spells, falling back to the paths a unio...
Definition value_set.cpp:560
void del_var(const std::string &id, const std::string &suffix)
Delete the value set for the given variable name and suffix.
Definition value_set.h:511
void dump() const
Write a textual representation of the value set to stderr.
Definition value_set.cpp:2048
bool make_union(const value_sett &new_values, bool keepnew=false)
Definition value_set.h:618
expr2tc make_member(const expr2tc &src, const irep_idt &component_name)
Attempt to extract the member of an expression statically.
Definition value_set.cpp:1988
std::optional< BigInt > constant_pointer_arith_offset(const expr2tc &non_ptr_op, const type2tc &subtype, bool subtracting) const
The byte offset a constant operand of pointer arithmetic contributes, already signed by subtracting; ...
Definition value_set.cpp:426
bool erase(const std::string &name)
Remove the given pointer value set from the map.
Definition value_set.h:456
unsigned int get_natural_alignment(const expr2tc &e) const
Get the natural alignment unit of a reference to e.
Definition value_set.h:302
void output(std::ostream &out) const
Dump the value set's textual representation to the given iostream.
Definition value_set.cpp:23
value_sett & operator=(const value_sett &ref)
Definition value_set.h:86
void add_vars(const std::list< entryt > &vars)
Add a value set for each variable in the given list.
Definition value_set.h:590
void assign(const expr2tc &lhs, const expr2tc &rhs, bool add_to_sets=false)
Interpret an assignment, and update value sets to reflect it.
Definition value_set.cpp:1551
valuest values
Storage for all the value sets for all the variables in the program.
Definition value_set.h:873
unsigned location_number
Location number of the instruction this value set is attached to; used to identify allocation sites f...
Definition value_set.h:860
void get_reference_set(const expr2tc &expr, value_setst::valuest &dest) const
Determine the set of variables that expr refers to.
Definition value_set.cpp:1143
void clear()
Clear all value records from this value set.
Definition value_set.h:493
bool insert(object_mapt &dest, const expr2tc &expr, const objectt &object) const
Definition value_set.h:448
const namespacet & ns
Namespace for looking up types against.
Definition value_set.h:876
static object_numberingt object_numbering
Object to assign numbers to objects – i.e., the numbers in the map of a object_mapt.
Definition value_set.h:868
static std::string concat_key(const std::string &id, const std::string &suffix)
Compose the identifier + suffix map key into a single pre-sized buffer, avoiding the temporary that i...
Definition value_set.h:580
static void obj_numbering_ref(unsigned int num)
Definition value_set.cpp:2055
bool insert(object_mapt &dest, object_mapt::const_iterator it) const
Definition value_set.h:366
unsigned int offset2align(const expr2tc &e, const BigInt &m) const
Definition value_set.h:321
unsigned long xchg_num
Definition value_set.h:879
value_sett(const value_sett &ref)
Definition value_set.h:77
void retire_objectless_operand(object_mapt &op0_set, object_mapt &op1_set, object_mapt &dest) const
Recursive body of get_value_set.
Definition value_set.cpp:208
void assign_struct_union(const expr2tc &lhs, const expr2tc &rhs, const type2tc &lhs_type, bool add_to_sets)
assign()'s struct/union arm, split out to keep assign() one dispatch.
Definition value_set.cpp:1464
bool insert(object_mapt &dest, const expr2tc &src, const BigInt &offset) const
Definition value_set.h:371
void do_end_function(const expr2tc &lhs)
During static analysis, simulate the return values assignment to the given lhs at the end of the func...
Definition value_set.cpp:1917
static void obj_numbering_deref(unsigned int num)
Definition value_set.cpp:2060
irep_idt xchg_name
Definition value_set.h:878
void get_reference_set_rec(const expr2tc &expr, object_mapt &dest) const
Recursive implementation of get_reference_set.
Definition value_set.cpp:1158
void get_reference_set(const expr2tc &expr, object_mapt &dest) const
Internal get_reference_set method.
Definition value_set.h:812
void offset_pointer_arith_objects(const object_mapt &pointer_expr_set, const expr2tc &ptr_op, const std::optional< BigInt > &total_offs, object_mapt &dest) const
Fold total_offs into every object of pointer_expr_set, tracking alignment where the offset or the obj...
Definition value_set.cpp:491
void apply_code(const expr2tc &code)
When using value_sett for static analysis, takes a code statement and sends any assignments contained...
Definition value_set.cpp:1927
bool make_union(object_mapt &dest, const object_mapt &src) const
Join the two given object maps.
Definition value_set.cpp:160
static irep_idt entry_key(const entryt &e)
The map key is identifier + suffix.
Definition value_set.h:525
void get_constant_value_set(const expr2tc &expr, object_mapt &dest, const std::string &suffix, const type2tc &original_type, bool under_deref) const
The constant cases of get_value_set_rec: what a value reaches this code as once constant propagation ...
Definition value_set.cpp:335
value_sett(const namespacet &_ns)
Primary constructor.
Definition value_set.h:67
void add_var(const entryt &e)
Definition value_set.h:505
static object_number_numberingt obj_numbering_refset
Definition value_set.h:869
void add_var(const std::string &id, const std::string &suffix)
Add a value set for the given variable name and suffix.
Definition value_set.h:500
void set(object_mapt &dest, object_mapt::const_iterator it) const
Insert an object record element into an object map.
Definition value_set.h:353
void erase_object(const std::string &id, const type2tc &type, const std::string &suffix="")
Remove the value sets of an object of type named id: its own and those of its members and elements,...
Definition value_set.cpp:2070
void get_value_set(const expr2tc &expr, value_setst::valuest &dest) const
Get the set of things that an expression might point at.
Definition value_set.cpp:174
bool update_object_map(const entryt &e, const object_mapt &om, bool merge)
Overwrite (merge=false) or union-into (merge=true) the object map recorded for the given entry.
Definition value_set.h:545
Definition value_set.h:885
@ other
Definition converter_compare.cpp:887
Classes and definitions for non-stringy internal representation.
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
Definition exception.cpp:51
const T & min(const T &left, const T &right)
Definition min_max.h:19
uint256_t key
Definition solidity_mapping.c:1
const array_typet & to_array_type(const typet &type)
Definition std_types.h:425
#define true
Definition stdbool.h:11
Record for a particular value set: stores the identity of the variable that points at this set of obj...
Definition value_set.h:247
bool operator!=(const entryt &e) const
Definition value_set.h:278
entryt(std::string _identifier, const std::string &_suffix)
Definition value_set.h:265
std::string suffix
Additional suffix data – an L1 variable might actually contain several pointers.
Definition value_set.h:261
std::string identifier
The L1 name of the pointer variable that's doing the pointing.
Definition value_set.h:253
bool operator==(const entryt &e) const
Definition value_set.h:273
object_mapt object_map
The map of objects -> their offset data.
Definition value_set.h:251
BigInt type_byte_size_default(const type2tc &type, const BigInt &defaultval, const namespacet *ns)
Definition type_byte_size.cpp:225
hash_numbering< expr2tc, irep2_hash > object_numberingt
Definition value_set.h:60
std::optional< std::pair< size_t, size_t > > match_leading_component(const std::vector< irep_idt > &names, const std::string &rest)
Code for tracking "value sets" across assignments in ESBMC.
Definition value_set.cpp:235
hash_numbering< unsigned, std::hash< unsigned > > object_number_numberingt
Definition value_set.h:61