CBMC
interval_abstract_value.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3  Module: analyses variable-sensitivity intervals
4 
5  Author: Diffblue Ltd.
6 
7 \*******************************************************************/
8 
9 #include <ostream>
10 
11 #include <util/arith_tools.h>
12 #include <util/bitvector_types.h>
13 #include <util/expr_util.h>
14 #include <util/invariant.h>
15 #include <util/make_unique.h>
16 #include <util/simplify_expr.h>
17 
18 #include "abstract_environment.h"
21 #include "widened_range.h"
22 
24  const constant_interval_exprt &interval,
25  const namespacet &n);
26 
28 {
29 public:
31  const constant_interval_exprt &interval_,
32  const namespacet &n)
33  : interval(interval_),
34  index(nil_exprt()),
35  next(interval.get_lower()),
36  upper(interval.get_upper()),
37  ns(n)
38  {
39  }
40 
41  const exprt &current() const override
42  {
43  return index;
44  }
45  bool advance_to_next() override
46  {
47  index = next;
50  .is_true();
51  }
52 
54  {
56  }
57 
58 private:
59  static exprt next_element(const exprt &cur, const namespacet &ns)
60  {
61  return simplify_expr(plus_exprt(cur, from_integer(1, cur.type())), ns);
62  }
63 
68  const namespacet &ns;
69 };
70 
72  const constant_interval_exprt &interval,
73  const namespacet &n)
74 {
75  return util_make_unique<interval_index_ranget>(interval, n);
76 }
77 
78 static inline bool
79 bvint_value_is_max(const typet &type, const mp_integer &value)
80 {
81  PRECONDITION(type.id() == ID_signedbv || type.id() == ID_unsignedbv);
82  if(type.id() == ID_signedbv)
83  {
84  return to_signedbv_type(type).largest() == value;
85  }
86  else
87  {
88  return to_unsignedbv_type(type).largest() == value;
89  }
90 }
91 
92 static inline bool
93 bvint_value_is_min(const typet &type, const mp_integer &value)
94 {
95  PRECONDITION(type.id() == ID_signedbv || type.id() == ID_unsignedbv);
96  if(type.id() == ID_signedbv)
97  {
98  return to_signedbv_type(type).smallest() == value;
99  }
100  else
101  {
102  return to_unsignedbv_type(type).smallest() == value;
103  }
104 }
105 
106 static inline constant_interval_exprt
108 {
109  return constant_interval_exprt(min_exprt(value.type()), value);
110 }
111 
112 static inline constant_interval_exprt
114 {
115  return constant_interval_exprt(value, max_exprt(value.type()));
116 }
117 
118 static inline mp_integer force_value_from_expr(const exprt &value)
119 {
121  optionalt<mp_integer> maybe_integer_value = numeric_cast<mp_integer>(value);
122  INVARIANT(maybe_integer_value.has_value(), "Input has to have a value");
123  return maybe_integer_value.value();
124 }
125 
126 static inline constant_interval_exprt
128 {
129  mp_integer integer_value = force_value_from_expr(value);
130  if(!bvint_value_is_min(value.type(), integer_value))
132  min_exprt(value.type()), from_integer(integer_value - 1, value.type()));
133  else
134  return constant_interval_exprt::bottom(value.type());
135 }
136 
137 static inline constant_interval_exprt
139 {
140  mp_integer integer_value = force_value_from_expr(value);
141  if(!bvint_value_is_max(value.type(), integer_value))
143  from_integer(integer_value + 1, value.type()), max_exprt(value.type()));
144  else
145  return constant_interval_exprt::bottom(value.type());
146 }
147 
148 static inline bool represents_interval(const exprt &expr)
149 {
150  const exprt &e = skip_typecast(expr);
151  return (e.id() == ID_constant_interval || e.id() == ID_constant);
152 }
153 
155 {
156  const exprt &e = skip_typecast(expr);
157 
158  if(e.id() == ID_constant_interval)
159  {
160  return to_constant_interval_expr(e);
161  }
162  else if(e.id() == ID_constant)
163  {
164  return constant_interval_exprt(e, e);
165  }
166  else
167  {
168  // not directly representable, so just return TOP
169  return constant_interval_exprt(e.type());
170  }
171 }
172 
173 static inline irep_idt invert_relation(const irep_idt &relation)
174 {
175  PRECONDITION(
176  relation == ID_le || relation == ID_lt || relation == ID_ge ||
177  relation == ID_gt || relation == ID_equal);
178  if(relation == ID_le)
179  return ID_ge;
180  if(relation == ID_ge)
181  return ID_le;
182  if(relation == ID_lt)
183  return ID_gt;
184  if(relation == ID_gt)
185  return ID_lt;
186  return relation;
187 }
188 
195 {
196  PRECONDITION(e.operands().size() == 2);
197  const auto &relation = e.id();
198  const auto &binary_e = to_binary_expr(e);
199  const auto &lhs = binary_e.lhs();
200  const auto &rhs = binary_e.rhs();
201  PRECONDITION(
202  relation == ID_le || relation == ID_lt || relation == ID_ge ||
203  relation == ID_gt || relation == ID_equal);
204  PRECONDITION(lhs.id() == ID_constant || lhs.id() == ID_symbol);
205  PRECONDITION(rhs.id() == ID_constant || rhs.id() == ID_symbol);
206  PRECONDITION(lhs.id() != rhs.id());
207 
208  const auto the_constant_part_of_the_relation =
209  (rhs.id() == ID_symbol ? lhs : rhs);
210  const auto maybe_inverted_relation =
211  (rhs.id() == ID_symbol ? invert_relation(relation) : relation);
212 
213  if(maybe_inverted_relation == ID_le)
214  return interval_from_x_le_value(the_constant_part_of_the_relation);
215  if(maybe_inverted_relation == ID_lt)
216  return interval_from_x_lt_value(the_constant_part_of_the_relation);
217  if(maybe_inverted_relation == ID_ge)
218  return interval_from_x_ge_value(the_constant_part_of_the_relation);
219  if(maybe_inverted_relation == ID_gt)
220  return interval_from_x_gt_value(the_constant_part_of_the_relation);
221  INVARIANT(
222  maybe_inverted_relation == ID_equal, "We excluded other cases above");
224  the_constant_part_of_the_relation, the_constant_part_of_the_relation);
225 }
226 
228  : abstract_value_objectt(t), interval(t)
229 {
230 }
231 
233  const typet &t,
234  bool tp,
235  bool bttm)
236  : abstract_value_objectt(t, tp, bttm), interval(t)
237 {
238 }
239 
241 {
242  if(e.is_top())
243  return true;
244 
245  if(e.get_lower().is_false() && e.get_upper().is_true())
246  return true;
247  if(
248  e.type().id() == ID_c_bool && e.get_lower().is_zero() &&
249  e.get_upper().is_one())
250  return true;
251 
252  return false;
253 }
254 
256  const constant_interval_exprt &e)
257  : abstract_value_objectt(e.type(), new_interval_is_top(e), e.is_bottom()),
258  interval(e)
259 {
260 }
261 
263  const exprt &lower,
264  const exprt &upper)
266 {
267 }
268 
270  const exprt &e,
271  const abstract_environmentt &environment,
272  const namespacet &ns)
275  ? make_interval_expr(e)
276  : (e.operands().size() == 2 ? interval_from_relation(e)
277  : constant_interval_exprt(e.type())))
278 {
279 }
280 
282 {
283  // Attempt to reduce this interval to a constant expression
285  {
286  // Interval is the equivalent of a constant, so reduce it to a constant
288  }
290 #if 0
291  if(!is_top() && !is_bottom())
292  {
293  return this->interval;
294  }
295  else
296  {
298  }
299 #endif
300 }
301 
303 {
305 }
306 
308 {
309  return std::hash<std::string>{}(interval.pretty());
310 }
311 
313  const abstract_object_pointert &other) const
314 {
315  auto cast_other =
316  std::dynamic_pointer_cast<const interval_abstract_valuet>(other);
317  return cast_other && interval == cast_other->interval;
318 }
319 
321  std::ostream &out,
322  const ai_baset &ai,
323  const namespacet &ns) const
324 {
325  if(!is_top() && !is_bottom())
326  {
327  std::string lower_string;
328  std::string upper_string;
329 
330  if(interval.get_lower().id() == ID_min)
331  {
332  lower_string = "-INF";
333  }
334  else
335  {
336  INVARIANT(
337  interval.get_lower().id() == ID_constant,
338  "We only support constant limits");
339  lower_string =
341  }
342 
343  if(interval.get_upper().id() == ID_max)
344  {
345  upper_string = "+INF";
346  }
347  else
348  {
349  INVARIANT(
350  interval.get_upper().id() == ID_constant,
351  "We only support constant limits");
352  upper_string =
354  }
355 
356  out << "[" << lower_string << ", " << upper_string << "]";
357  }
358  else
359  {
360  abstract_objectt::output(out, ai, ns);
361  }
362 }
363 
365  const constant_interval_exprt &lhs,
366  const constant_interval_exprt &rhs)
367 {
368  auto widened = widened_ranget(lhs, rhs);
369 
370  // new interval ...
371  auto new_interval = constant_interval_exprt(
372  widened.widened_lower_bound, widened.widened_upper_bound);
373  return interval_abstract_valuet::make_interval(new_interval);
374 }
375 
377  const abstract_value_pointert &other,
378  const widen_modet &widen_mode) const
379 {
380  if(other->is_bottom())
381  return shared_from_this();
382 
383  auto other_interval = other->to_interval();
384 
385  if(is_bottom())
386  return make_interval(other_interval);
387 
388  if(interval.contains(other_interval))
389  return shared_from_this();
390 
391  if(widen_mode == widen_modet::could_widen)
392  return widening_merge(interval, other_interval);
393 
394  auto lower_bound = constant_interval_exprt::get_min(
395  interval.get_lower(), other_interval.get_lower());
396  auto upper_bound = constant_interval_exprt::get_max(
397  interval.get_upper(), other_interval.get_upper());
398 
399  return make_interval(lower_bound, upper_bound);
400 }
401 
403  const abstract_value_pointert &other) const
404 {
405  auto other_interval = other->to_interval();
406 
407  if(other_interval.contains(interval))
408  return shared_from_this();
409 
410  if(interval.contains(other_interval))
411  return make_interval(other_interval);
412 
413  auto lower_bound = constant_interval_exprt::get_max(
414  interval.get_lower(), other_interval.get_lower());
415  auto upper_bound = constant_interval_exprt::get_min(
416  interval.get_upper(), other_interval.get_upper());
417 
418  // if the interval is valid, we have a meet!
419  if(constant_interval_exprt::less_than_or_equal(lower_bound, upper_bound))
420  return make_interval(constant_interval_exprt(lower_bound, upper_bound));
421 
422  return make_interval(interval.type(), false, true);
423 }
424 
427 {
428  if(is_top() || is_bottom() || interval.is_top() || interval.is_bottom())
429  return make_empty_index_range();
430  if(interval.get_lower().id() == ID_min || interval.get_upper().id() == ID_max)
431  return make_empty_index_range();
432 
434 }
435 
438 {
439  return make_single_value_range(shared_from_this());
440 }
441 
443  const exprt &lower,
444  const exprt &upper) const
445 {
446  auto lower_bound =
448  auto upper_bound =
450 
451  if(constant_interval_exprt::greater_than(lower_bound, upper_bound))
452  return as_value(mutable_clone());
453 
454  auto constrained_interval = constant_interval_exprt(lower_bound, upper_bound);
455  return as_value(
456  make_interval(constant_interval_exprt(lower_bound, upper_bound)));
457 }
458 
460 {
462  return equal_exprt(name, interval.get_lower());
463 
464  auto lower_bound = binary_relation_exprt(interval.get_lower(), ID_le, name);
465  auto upper_bound = binary_relation_exprt(name, ID_le, interval.get_upper());
466 
467  return and_exprt(lower_bound, upper_bound);
468 }
469 
471  abstract_object_statisticst &statistics,
472  abstract_object_visitedt &visited,
473  const abstract_environmentt &env,
474  const namespacet &ns) const
475 {
476  abstract_objectt::get_statistics(statistics, visited, env, ns);
479  {
481  }
482  statistics.objects_memory_usage += memory_sizet::from_bytes(sizeof(*this));
483 }
widen_modet
widen_modet
Definition: abstract_environment.h:32
interval_abstract_valuet::index_range_implementation
index_range_implementation_ptrt index_range_implementation(const namespacet &ns) const override
Definition: interval_abstract_value.cpp:426
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
interval_index_ranget::index
exprt index
Definition: interval_abstract_value.cpp:65
to_unsignedbv_type
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a typet to an unsignedbv_typet.
Definition: bitvector_types.h:191
abstract_object_pointert
sharing_ptrt< class abstract_objectt > abstract_object_pointert
Definition: abstract_object.h:69
skip_typecast
const exprt & skip_typecast(const exprt &expr)
find the expression nested inside typecasts, if any
Definition: expr_util.cpp:217
abstract_objectt::is_top
virtual bool is_top() const
Find out if the abstract object is top.
Definition: abstract_object.cpp:155
mp_integer
BigInt mp_integer
Definition: smt_terms.h:17
index_range_implementationt
Definition: abstract_value_object.h:28
abstract_objectt::output
virtual void output(std::ostream &out, const class ai_baset &ai, const namespacet &ns) const
Print the value of the abstract object.
Definition: abstract_object.cpp:190
interval_abstract_valuet::output
void output(std::ostream &out, const class ai_baset &ai, const class namespacet &ns) const override
Definition: interval_abstract_value.cpp:320
arith_tools.h
integer_bitvector_typet::smallest
mp_integer smallest() const
Return the smallest value that can be represented using this type.
Definition: bitvector_types.cpp:33
typet
The type of an expression, extends irept.
Definition: type.h:28
interval_index_ranget::advance_to_next
bool advance_to_next() override
Definition: interval_abstract_value.cpp:45
irept::pretty
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:495
constant_interval_exprt::get_max
static exprt get_max(const exprt &a, const exprt &b)
Definition: interval.cpp:959
abstract_objectt::type
virtual const typet & type() const
Get the real type of the variable this abstract object is representing.
Definition: abstract_object.cpp:47
constant_interval_exprt::is_bottom
static bool is_bottom(const constant_interval_exprt &a)
Definition: interval.cpp:1814
max_exprt
+∞ upper bound for intervals
Definition: interval.h:17
constant_interval_exprt::contains
bool contains(const constant_interval_exprt &interval) const
Definition: interval.cpp:1426
interval_abstract_valuet::meet_with_value
abstract_object_pointert meet_with_value(const abstract_value_pointert &other) const override
Meet another interval abstract object with this one.
Definition: interval_abstract_value.cpp:402
invariant.h
widened_ranget
Definition: widened_range.h:17
and_exprt
Boolean AND.
Definition: std_expr.h:2070
interval_abstract_valuet
Definition: interval_abstract_value.h:21
plus_exprt
The plus expression Associativity is not specified.
Definition: std_expr.h:946
abstract_environmentt
Definition: abstract_environment.h:40
exprt
Base class for all expressions.
Definition: expr.h:55
widened_range.h
min_exprt
-∞ upper bound for intervals
Definition: interval.h:30
exprt::is_true
bool is_true() const
Return whether the expression is a constant representing true.
Definition: expr.cpp:34
abstract_objectt::get_statistics
virtual void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const
Definition: abstract_object.cpp:310
bvint_value_is_max
static bool bvint_value_is_max(const typet &type, const mp_integer &value)
Definition: interval_abstract_value.cpp:79
interval_abstract_valuet::to_constant
exprt to_constant() const override
Converts to a constant expression if possible.
Definition: interval_abstract_value.cpp:281
make_interval_index_range
static index_range_implementation_ptrt make_interval_index_range(const constant_interval_exprt &interval, const namespacet &n)
Definition: interval_abstract_value.cpp:71
equal_exprt
Equality.
Definition: std_expr.h:1305
interval_from_relation
static constant_interval_exprt interval_from_relation(const exprt &e)
Builds an interval representing all values satisfying the input expression.
Definition: interval_abstract_value.cpp:194
interval_abstract_valuet::set_top_internal
void set_top_internal() override
Definition: interval_abstract_value.cpp:302
interval_index_ranget::interval
const constant_interval_exprt & interval
Definition: interval_abstract_value.cpp:64
constant_interval_exprt
Represents an interval of values.
Definition: interval.h:47
make_interval_expr
static constant_interval_exprt make_interval_expr(const exprt &expr)
Definition: interval_abstract_value.cpp:154
constant_interval_exprt::greater_than
tvt greater_than(const constant_interval_exprt &o) const
Definition: interval.cpp:398
exprt::is_false
bool is_false() const
Return whether the expression is a constant representing false.
Definition: expr.cpp:43
constant_interval_exprt::is_int
bool is_int() const
Definition: interval.cpp:1064
value_range_implementation_ptrt
std::unique_ptr< value_range_implementationt > value_range_implementation_ptrt
Definition: abstract_value_object.h:131
to_binary_expr
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
Definition: std_expr.h:660
interval_from_x_le_value
static constant_interval_exprt interval_from_x_le_value(const exprt &value)
Definition: interval_abstract_value.cpp:107
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
interval_abstract_valuet::internal_hash
size_t internal_hash() const override
Definition: interval_abstract_value.cpp:307
make_empty_index_range
index_range_implementation_ptrt make_empty_index_range()
Definition: abstract_value_object.cpp:76
exprt::type
typet & type()
Return the type of the expression.
Definition: expr.h:84
make_unique.h
force_value_from_expr
static mp_integer force_value_from_expr(const exprt &value)
Definition: interval_abstract_value.cpp:118
interval_from_x_gt_value
static constant_interval_exprt interval_from_x_gt_value(const exprt &value)
Definition: interval_abstract_value.cpp:138
abstract_object_statisticst
Definition: abstract_object_statistics.h:18
id2string
const std::string & id2string(const irep_idt &d)
Definition: irep.h:47
abstract_value_objectt
Definition: abstract_value_object.h:239
interval_index_ranget::ns
const namespacet & ns
Definition: interval_abstract_value.cpp:68
constant_interval_exprt::is_single_value_interval
bool is_single_value_interval() const
Definition: interval.cpp:1864
binary_predicate_exprt
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
Definition: std_expr.h:675
PRECONDITION
#define PRECONDITION(CONDITION)
Definition: invariant.h:463
nil_exprt
The NIL expression.
Definition: std_expr.h:3025
bitvector_types.h
interval_index_ranget::next
exprt next
Definition: interval_abstract_value.cpp:66
interval_index_ranget::next_element
static exprt next_element(const exprt &cur, const namespacet &ns)
Definition: interval_abstract_value.cpp:59
abstract_environment.h
constant_interval_exprt::bottom
constant_interval_exprt bottom() const
Definition: interval.cpp:1057
abstract_objectt::to_constant
virtual exprt to_constant() const
Converts to a constant expression if possible.
Definition: abstract_object.cpp:170
abstract_value_objectt::as_value
sharing_ptrt< const abstract_value_objectt > as_value(const abstract_object_pointert &obj) const
Definition: abstract_value_object.cpp:697
simplify_expr
exprt simplify_expr(exprt src, const namespacet &ns)
Definition: simplify_expr.cpp:2931
interval_abstract_valuet::get_statistics
void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const override
Definition: interval_abstract_value.cpp:470
irept::id
const irep_idt & id() const
Definition: irep.h:396
abstract_object_visitedt
std::set< abstract_object_pointert > abstract_object_visitedt
Definition: abstract_object.h:70
interval_abstract_valuet::mutable_clone
internal_abstract_object_pointert mutable_clone() const override
Definition: interval_abstract_value.h:74
represents_interval
static bool represents_interval(const exprt &expr)
Definition: interval_abstract_value.cpp:148
new_interval_is_top
bool new_interval_is_top(const constant_interval_exprt &e)
Definition: interval_abstract_value.cpp:240
interval_abstract_valuet::constrain
abstract_value_pointert constrain(const exprt &lower, const exprt &upper) const override
Definition: interval_abstract_value.cpp:442
interval_index_ranget
Definition: interval_abstract_value.cpp:27
optionalt
nonstd::optional< T > optionalt
Definition: optional.h:35
interval_index_ranget::reset
index_range_implementation_ptrt reset() const override
Definition: interval_abstract_value.cpp:53
interval_abstract_valuet::merge_with_value
abstract_object_pointert merge_with_value(const abstract_value_pointert &other, const widen_modet &widen_mode) const override
Merge another interval abstract object with this one.
Definition: interval_abstract_value.cpp:376
to_signedbv_type
const signedbv_typet & to_signedbv_type(const typet &type)
Cast a typet to a signedbv_typet.
Definition: bitvector_types.h:241
simplify_expr.h
interval_from_x_ge_value
static constant_interval_exprt interval_from_x_ge_value(const exprt &value)
Definition: interval_abstract_value.cpp:113
exprt::is_zero
bool is_zero() const
Return whether the expression is a constant representing 0.
Definition: expr.cpp:65
constant_interval_exprt::is_top
static bool is_top(const constant_interval_exprt &a)
Definition: interval.cpp:1809
expr_util.h
Deprecated expression utility functions.
interval_abstract_valuet::make_interval
static std::shared_ptr< interval_abstract_valuet > make_interval(Args &&... args)
Definition: interval_abstract_value.h:37
make_single_value_range
value_range_implementation_ptrt make_single_value_range(const abstract_object_pointert &value)
Definition: abstract_value_object.cpp:115
interval_index_ranget::upper
exprt upper
Definition: interval_abstract_value.cpp:67
interval_abstract_valuet::internal_equality
bool internal_equality(const abstract_object_pointert &other) const override
Definition: interval_abstract_value.cpp:312
abstract_object_statistics.h
from_integer
constant_exprt from_integer(const mp_integer &int_value, const typet &type)
Definition: arith_tools.cpp:100
bvint_value_is_min
static bool bvint_value_is_min(const typet &type, const mp_integer &value)
Definition: interval_abstract_value.cpp:93
interval_abstract_value.h
interval_abstract_valuet::to_predicate_internal
exprt to_predicate_internal(const exprt &name) const override
to_predicate implementation - derived classes will override
Definition: interval_abstract_value.cpp:459
to_constant_interval_expr
const constant_interval_exprt & to_constant_interval_expr(const exprt &expr)
Definition: interval.h:458
interval_from_x_lt_value
static constant_interval_exprt interval_from_x_lt_value(const exprt &value)
Definition: interval_abstract_value.cpp:127
binary_relation_exprt
A base class for relations, i.e., binary predicates whose two operands have the same type.
Definition: std_expr.h:706
abstract_object_statisticst::objects_memory_usage
memory_sizet objects_memory_usage
An underestimation of the memory usage of the abstract objects.
Definition: abstract_object_statistics.h:28
ai_baset
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition: ai.h:118
interval_abstract_valuet::interval_abstract_valuet
interval_abstract_valuet(const typet &t)
Definition: interval_abstract_value.cpp:227
abstract_object_statisticst::number_of_single_value_intervals
std::size_t number_of_single_value_intervals
Definition: abstract_object_statistics.h:21
constant_interval_exprt::less_than_or_equal
tvt less_than_or_equal(const constant_interval_exprt &o) const
Definition: interval.cpp:404
widen_modet::could_widen
@ could_widen
constant_interval_exprt::get_lower
const exprt & get_lower() const
Definition: interval.cpp:29
integer_bitvector_typet::largest
mp_integer largest() const
Return the largest value that can be represented using this type.
Definition: bitvector_types.cpp:38
exprt::is_one
bool is_one() const
Return whether the expression is a constant representing 1.
Definition: expr.cpp:114
interval_index_ranget::current
const exprt & current() const override
Definition: interval_abstract_value.cpp:41
constant_interval_exprt::get_upper
const exprt & get_upper() const
Definition: interval.cpp:34
constant_interval_exprt::get_min
static exprt get_min(const exprt &a, const exprt &b)
Definition: interval.cpp:964
exprt::operands
operandst & operands()
Definition: expr.h:94
index_range_implementation_ptrt
std::unique_ptr< index_range_implementationt > index_range_implementation_ptrt
Definition: abstract_value_object.h:26
abstract_value_objectt::abstract_value_pointert
sharing_ptrt< const abstract_value_objectt > abstract_value_pointert
Definition: abstract_value_object.h:302
interval_abstract_valuet::interval
constant_interval_exprt interval
Definition: interval_abstract_value.h:100
INVARIANT
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Definition: invariant.h:423
abstract_objectt::is_bottom
virtual bool is_bottom() const
Find out if the abstract object is bottom.
Definition: abstract_object.cpp:160
interval_abstract_valuet::value_range_implementation
value_range_implementation_ptrt value_range_implementation() const override
Definition: interval_abstract_value.cpp:437
widening_merge
abstract_object_pointert widening_merge(const constant_interval_exprt &lhs, const constant_interval_exprt &rhs)
Definition: interval_abstract_value.cpp:364
constant_exprt::get_value
const irep_idt & get_value() const
Definition: std_expr.h:2950
memory_sizet::from_bytes
static memory_sizet from_bytes(std::size_t bytes)
Definition: memory_units.cpp:38
interval_index_ranget::interval_index_ranget
interval_index_ranget(const constant_interval_exprt &interval_, const namespacet &n)
Definition: interval_abstract_value.cpp:30
invert_relation
static irep_idt invert_relation(const irep_idt &relation)
Definition: interval_abstract_value.cpp:173
validation_modet::INVARIANT
@ INVARIANT
abstract_object_statisticst::number_of_interval_abstract_objects
std::size_t number_of_interval_abstract_objects
Definition: abstract_object_statistics.h:20
to_constant_expr
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
Definition: std_expr.h:2992