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 54 of file NumericValue.h.
|
protecteddefault |
|
inline |
Definition at line 69 of file NumericValue.h.
|
inline |
|
inline |
|
inlinevirtual |
Definition at line 98 of file NumericValue.h.
|
inline |
|
inline |
Definition at line 189 of file NumericValue.h.
Definition at line 714 of file NumericValue.h.
|
inline |
Definition at line 703 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 661 of file NumericValue.h.
|
inline |
Definition at line 708 of file NumericValue.h.
|
inline |
Definition at line 113 of file NumericValue.h.
|
inline |
Definition at line 107 of file NumericValue.h.
|
inline |
Definition at line 101 of file NumericValue.h.
|
inline |
Definition at line 698 of file NumericValue.h.
|
inline |
Definition at line 645 of file NumericValue.h.
|
inline |
Definition at line 143 of file NumericValue.h.
|
inlinestatic |
Definition at line 149 of file NumericValue.h.
|
inline |
Definition at line 161 of file NumericValue.h.
|
inlinestatic |
Definition at line 619 of file NumericValue.h.
|
inlinestatic |
Definition at line 601 of file NumericValue.h.
|
inlinestatic |
Definition at line 137 of file NumericValue.h.
|
inline |
|
inline |
|
inlinestatic |
Definition at line 131 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 280 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 364 of file NumericValue.h.
|
inline |
Definition at line 125 of file NumericValue.h.
|
inline |
Definition at line 119 of file NumericValue.h.
Definition at line 682 of file NumericValue.h.
|
friend |
Definition at line 637 of file NumericValue.h.
|
friend |
|
friend |
Definition at line 543 of file NumericValue.h.
|
friend |
Definition at line 585 of file NumericValue.h.
|
friend |
Definition at line 569 of file NumericValue.h.
|
friend |
Definition at line 499 of file NumericValue.h.
|
friend |
Definition at line 225 of file NumericValue.h.
|
friend |
Definition at line 420 of file NumericValue.h.
|
friend |
Definition at line 471 of file NumericValue.h.
|
friend |
Definition at line 487 of file NumericValue.h.
|
friend |
Definition at line 438 of file NumericValue.h.
|
friend |
Definition at line 327 of file NumericValue.h.
|
friend |
Definition at line 334 of file NumericValue.h.
|
friend |
Definition at line 342 of file NumericValue.h.
|
friend |
Definition at line 446 of file NumericValue.h.
|
friend |
Definition at line 237 of file NumericValue.h.
|
friend |
Definition at line 527 of file NumericValue.h.
|
friend |
Definition at line 552 of file NumericValue.h.
|
friend |
Definition at line 244 of file NumericValue.h.
|
friend |
Reload operator.
Definition at line 219 of file NumericValue.h.
|
friend |
Definition at line 231 of file NumericValue.h.
|
friend |
Definition at line 251 of file NumericValue.h.
|
friend |
Definition at line 509 of file NumericValue.h.
|
friend |
Definition at line 465 of file NumericValue.h.
|
friend |
Definition at line 477 of file NumericValue.h.
|
friend |
Definition at line 493 of file NumericValue.h.
|
protected |
Definition at line 58 of file NumericValue.h.
|
protected |
Definition at line 57 of file NumericValue.h.