|
Static Value-Flow Analysis
|
A class representing a bounded 64-bit integer. More...
#include <NumericValue.h>
Public Member Functions | |
| BoundedInt (s64_t fVal) | |
| BoundedInt (s64_t fVal, bool isInf) | |
| BoundedInt (const BoundedInt &rhs) | |
| BoundedInt & | operator= (const BoundedInt &rhs) |
| BoundedInt (BoundedInt &&rhs) | |
| BoundedInt & | operator= (BoundedInt &&rhs) |
| virtual | ~BoundedInt () |
| bool | is_plus_infinity () const |
| bool | is_minus_infinity () const |
| bool | is_infinity () const |
| void | set_plus_infinity () |
| void | set_minus_infinity () |
| bool | is_zero () const |
| bool | equal (const BoundedInt &rhs) const |
| bool | leq (const BoundedInt &rhs) const |
| bool | geq (const BoundedInt &rhs) const |
| bool | is_true () const |
| s64_t | getNumeral () const |
| Retrieves the numeral value of the BoundedInt object. | |
| virtual const std::string | to_string () const |
| bool | is_real () const |
| s64_t | getIntNumeral () const |
| double | getRealNumeral () const |
| const double | getFVal () const |
Static Public Member Functions | |
| static BoundedInt | plus_infinity () |
| static BoundedInt | minus_infinity () |
| static bool | isZero (const BoundedInt &expr) |
| static BoundedInt | safeNeg (const BoundedInt &value) |
| static BoundedInt | safeAdd (const BoundedInt &lhs, const BoundedInt &rhs) |
| static BoundedInt | safeSub (const BoundedInt &lhs, const BoundedInt &rhs) |
| static BoundedInt | safeMul (const BoundedInt &lhs, const BoundedInt &rhs) |
| static BoundedInt | safeDiv (const BoundedInt &lhs, const BoundedInt &rhs) |
| static BoundedInt | safeRem (const BoundedInt &lhs, const BoundedInt &rhs) |
| static BoundedInt | min (std::vector< BoundedInt > &_l) |
| static BoundedInt | max (std::vector< BoundedInt > &_l) |
Protected Member Functions | |
| BoundedInt ()=default | |
Protected Attributes | |
| s64_t | _iVal |
| bool | _isInf |
A class representing a bounded 64-bit integer.
BoundedInt is a class that represents a 64-bit integer that can also represent positive and negative infinity. It includes a 64-bit integer value and a boolean flag indicating whether the value is infinite. If the value is infinite, the integer value is used to represent the sign of infinity (1 for positive infinity and -1 for negative infinity).
Definition at line 57 of file NumericValue.h.
|
protecteddefault |
|
inline |
Definition at line 72 of file NumericValue.h.
|
inline |
Definition at line 76 of file NumericValue.h.
|
inline |
Definition at line 79 of file NumericValue.h.
|
inline |
Definition at line 90 of file NumericValue.h.
|
inlinevirtual |
Definition at line 101 of file NumericValue.h.
|
inline |
Definition at line 158 of file NumericValue.h.
|
inline |
Definition at line 192 of file NumericValue.h.
|
inline |
Definition at line 694 of file NumericValue.h.
|
inline |
Definition at line 683 of file NumericValue.h.
|
inline |
Retrieves the numeral value of the BoundedInt object.
This method returns the numeral representation of the BoundedInt object. If the object represents negative infinity, it returns the minimum representable 64-bit integer. If the object represents positive infinity, it returns the maximum representable 64-bit integer. Otherwise, it returns the actual 64-bit integer value of the object.
Definition at line 641 of file NumericValue.h.
|
inline |
Definition at line 688 of file NumericValue.h.
|
inline |
Definition at line 116 of file NumericValue.h.
|
inline |
Definition at line 110 of file NumericValue.h.
|
inline |
Definition at line 104 of file NumericValue.h.
|
inline |
Definition at line 678 of file NumericValue.h.
|
inline |
Definition at line 625 of file NumericValue.h.
|
inline |
Definition at line 146 of file NumericValue.h.
|
inlinestatic |
Definition at line 152 of file NumericValue.h.
|
inline |
Definition at line 164 of file NumericValue.h.
|
inlinestatic |
Definition at line 599 of file NumericValue.h.
|
inlinestatic |
Definition at line 581 of file NumericValue.h.
|
inlinestatic |
Definition at line 140 of file NumericValue.h.
|
inline |
Definition at line 93 of file NumericValue.h.
|
inline |
Definition at line 82 of file NumericValue.h.
|
inlinestatic |
Definition at line 134 of file NumericValue.h.
|
inlinestatic |
Definition at line 294 of file NumericValue.h.
|
inlinestatic |
Definition at line 368 of file NumericValue.h.
|
inlinestatic |
Definition at line 338 of file NumericValue.h.
|
inlinestatic |
Integer arithmetic policy for finite BoundedInt operands.
Representable results remain exact. Results outside the s64_t range are abstracted to positive or negative infinity. Arithmetic must never rely on signed wraparound or trigger C++ undefined behavior.
| Operation | Exceptional case | Result |
|---|---|---|
| -x | x == INT64_MIN | +inf |
| a + b | result > INT64_MAX | +inf |
| a + b | result < INT64_MIN | -inf |
| a - b | result > INT64_MAX | +inf |
| a - b | result < INT64_MIN | -inf |
| a * b | positive overflow | +inf |
| a * b | negative overflow | -inf |
| a / b | INT64_MIN / -1 | +inf |
| a / b | b == 0 | invalid |
| a % b | INT64_MIN % -1 | 0 |
| a % b | b == 0 | invalid |
Operations involving abstract infinities are handled separately by each helper according to the signs of the operands.
Definition at line 283 of file NumericValue.h.
|
inlinestatic |
Definition at line 389 of file NumericValue.h.
|
inlinestatic |
Definition at line 316 of file NumericValue.h.
|
inline |
Definition at line 128 of file NumericValue.h.
|
inline |
Definition at line 122 of file NumericValue.h.
|
inlinevirtual |
Definition at line 662 of file NumericValue.h.
|
friend |
Definition at line 617 of file NumericValue.h.
|
friend |
Definition at line 541 of file NumericValue.h.
|
friend |
Definition at line 523 of file NumericValue.h.
|
friend |
Definition at line 565 of file NumericValue.h.
|
friend |
Definition at line 549 of file NumericValue.h.
|
friend |
Definition at line 479 of file NumericValue.h.
|
friend |
Definition at line 228 of file NumericValue.h.
|
friend |
Definition at line 435 of file NumericValue.h.
|
friend |
Definition at line 451 of file NumericValue.h.
|
friend |
Definition at line 467 of file NumericValue.h.
|
friend |
Definition at line 425 of file NumericValue.h.
|
friend |
Definition at line 415 of file NumericValue.h.
|
friend |
Definition at line 420 of file NumericValue.h.
|
friend |
Definition at line 410 of file NumericValue.h.
|
friend |
Definition at line 430 of file NumericValue.h.
|
friend |
Definition at line 240 of file NumericValue.h.
|
friend |
Definition at line 507 of file NumericValue.h.
|
friend |
Definition at line 532 of file NumericValue.h.
|
friend |
Definition at line 247 of file NumericValue.h.
|
friend |
Reload operator.
Definition at line 222 of file NumericValue.h.
|
friend |
Definition at line 234 of file NumericValue.h.
|
friend |
Definition at line 254 of file NumericValue.h.
|
friend |
Definition at line 489 of file NumericValue.h.
|
friend |
Definition at line 445 of file NumericValue.h.
|
friend |
Definition at line 457 of file NumericValue.h.
|
friend |
Definition at line 473 of file NumericValue.h.
|
protected |
Definition at line 61 of file NumericValue.h.
|
protected |
Definition at line 60 of file NumericValue.h.