|
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 | safeAdd (const BoundedInt &lhs, const BoundedInt &rhs) |
| static BoundedInt | safeMul (const BoundedInt &lhs, const BoundedInt &rhs) |
| Performs safe multiplication of two BoundedInt objects. | |
| 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 0 for negative infinity).
Definition at line 55 of file NumericValue.h.
|
protecteddefault |
|
inline |
Definition at line 70 of file NumericValue.h.
|
inline |
|
inline |
|
inlinevirtual |
Definition at line 99 of file NumericValue.h.
|
inline |
|
inline |
Definition at line 190 of file NumericValue.h.
Definition at line 718 of file NumericValue.h.
|
inline |
Definition at line 707 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 665 of file NumericValue.h.
|
inline |
Definition at line 712 of file NumericValue.h.
|
inline |
Definition at line 114 of file NumericValue.h.
|
inline |
Definition at line 108 of file NumericValue.h.
|
inline |
Definition at line 102 of file NumericValue.h.
|
inline |
Definition at line 702 of file NumericValue.h.
|
inline |
Definition at line 649 of file NumericValue.h.
|
inline |
Definition at line 144 of file NumericValue.h.
|
inlinestatic |
Definition at line 150 of file NumericValue.h.
|
inline |
Definition at line 162 of file NumericValue.h.
|
inlinestatic |
Definition at line 623 of file NumericValue.h.
|
inlinestatic |
Definition at line 605 of file NumericValue.h.
|
inlinestatic |
Definition at line 138 of file NumericValue.h.
|
inline |
|
inline |
|
inlinestatic |
Definition at line 132 of file NumericValue.h.
|
inlinestatic |
Safely adds two BoundedInt objects.
This function adds two BoundedInt objects in a way that respects the bounds of the underlying s64_t type. It checks for conditions that would result in overflow or underflow and returns a representation of positive or negative infinity in those cases. If addition of the two numbers would result in a value that is within the representable range of s64_t, it performs the addition and returns the result. If the addition is not defined (e.g., positive infinity plus negative infinity), it asserts false to indicate an error.
| lhs | The first BoundedInt to add. This can be any valid BoundedInt, including positive and negative infinity. |
| rhs | The second BoundedInt to add. This can be any valid BoundedInt, including positive and negative infinity. |
Definition at line 281 of file NumericValue.h.
|
inlinestatic |
Performs safe multiplication of two BoundedInt objects.
This function ensures that the multiplication of two BoundedInt objects doesn't result in overflow or underflow. It returns the multiplication result if it can be represented within the range of a 64-bit integer. If the result would be larger than the maximum representable positive number, it returns positive infinity. If the result would be less than the minimum representable negative number, it returns negative infinity. If either of the inputs is zero, the result is zero. If either of the inputs is infinity, the result is determined by the signs of the inputs.
| lhs | The first BoundedInt to multiply. |
| rhs | The second BoundedInt to multiply. |
Definition at line 365 of file NumericValue.h.
|
inline |
Definition at line 126 of file NumericValue.h.
|
inline |
Definition at line 120 of file NumericValue.h.
Definition at line 686 of file NumericValue.h.
|
friend |
Definition at line 641 of file NumericValue.h.
|
friend |
|
friend |
Definition at line 547 of file NumericValue.h.
|
friend |
Definition at line 589 of file NumericValue.h.
|
friend |
Definition at line 573 of file NumericValue.h.
|
friend |
Definition at line 503 of file NumericValue.h.
|
friend |
Definition at line 226 of file NumericValue.h.
|
friend |
Definition at line 421 of file NumericValue.h.
|
friend |
Definition at line 475 of file NumericValue.h.
|
friend |
Definition at line 491 of file NumericValue.h.
|
friend |
Definition at line 439 of file NumericValue.h.
|
friend |
Definition at line 328 of file NumericValue.h.
|
friend |
Definition at line 335 of file NumericValue.h.
|
friend |
Definition at line 343 of file NumericValue.h.
|
friend |
Definition at line 447 of file NumericValue.h.
|
friend |
Definition at line 238 of file NumericValue.h.
|
friend |
Definition at line 531 of file NumericValue.h.
|
friend |
Definition at line 556 of file NumericValue.h.
|
friend |
Definition at line 245 of file NumericValue.h.
|
friend |
Reload operator.
Definition at line 220 of file NumericValue.h.
|
friend |
Definition at line 232 of file NumericValue.h.
|
friend |
Definition at line 252 of file NumericValue.h.
|
friend |
Definition at line 513 of file NumericValue.h.
|
friend |
Definition at line 469 of file NumericValue.h.
|
friend |
Definition at line 481 of file NumericValue.h.
|
friend |
Definition at line 497 of file NumericValue.h.
|
protected |
Definition at line 59 of file NumericValue.h.
|
protected |
Definition at line 58 of file NumericValue.h.