ROSE 0.11.145.147
|
Type of values manipulated by the PartialSymbolicSemantics domain.
A value is either known or unknown. Unknown values have a base name (unique ID number), offset, and sign.
Definition at line 61 of file PartialSymbolicSemantics.h.
#include <Rose/BinaryAnalysis/InstructionSemantics/PartialSymbolicSemantics.h>
Public Types | |
using | Super = BaseSemantics::SValue |
Base type. | |
using | Ptr = SValuePtr |
Shared-ownership pointer. | |
Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue | |
using | Ptr = SValuePtr |
Shared-ownership pointer. | |
Public Member Functions | |
virtual BaseSemantics::SValuePtr | bottom_ (size_t nbits) const override |
Data-flow bottom value. | |
virtual BaseSemantics::SValuePtr | undefined_ (size_t nbits) const override |
Create a new undefined semantic value. | |
virtual BaseSemantics::SValuePtr | unspecified_ (size_t nbits) const override |
Create a new unspecified semantic value. | |
virtual BaseSemantics::SValuePtr | number_ (size_t nbits, uint64_t value) const override |
Create a new concrete semantic value. | |
virtual BaseSemantics::SValuePtr | copy (size_t new_width=0) const override |
Create a new value from an existing value, changing the width if new_width is non-zero. | |
virtual Sawyer::Optional< BaseSemantics::SValuePtr > | createOptionalMerge (const BaseSemantics::SValuePtr &other, const BaseSemantics::MergerPtr &, const SmtSolverPtr &) const override |
Possibly create a new value by merging two existing values. | |
virtual BaseSemantics::SValuePtr | create (size_t nbits, uint64_t name, uint64_t offset, bool negate) const |
Virtual allocating constructor. | |
virtual void | hash (Combinatorics::Hasher &) const override |
Hash this semantic value. | |
virtual void | print (std::ostream &, BaseSemantics::Formatter &) const override |
Print a value to a stream using default format. | |
virtual bool | isBottom () const override |
Determines whether a value is a data-flow bottom. | |
virtual void | set_width (size_t nbits) override |
Virtual API. | |
virtual bool | may_equal (const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const override |
Virtual API. | |
virtual bool | must_equal (const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const override |
Virtual API. | |
virtual bool | is_number () const override |
Virtual API. | |
virtual uint64_t | get_number () const override |
Virtual API. | |
Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue | |
virtual SValuePtr | boolean_ (bool value) const |
Create a new, Boolean value. | |
SValuePtr | createMerged (const SValuePtr &other, const MergerPtr &merger, const SmtSolverPtr &solver) const |
Create a new value by merging two existing values. | |
size_t | nBits () const |
Property: value width. | |
bool | isConcrete () const |
Determines if the value is a concrete number. | |
Sawyer::Optional< uint64_t > | toUnsigned () const |
Converts a concrete value to a native unsigned integer. | |
Sawyer::Optional< int64_t > | toSigned () const |
Converts a concrete value to a native signed integer. | |
bool | mustEqual (const SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const |
Tests two values for equality. | |
bool | mayEqual (const SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const |
Tests two values for possible equality. | |
bool | isTrue () const |
Returns true if concrete non-zero. | |
bool | isFalse () const |
Returns true if concrete zero. | |
std::string | toString () const |
Render this symbolic expression as a string. | |
std::string | comment () const |
Property: Comment. | |
void | comment (const std::string &) const |
Property: Comment. | |
void | print (std::ostream &) const |
Print a value to a stream using default format. | |
WithFormatter | with_format (Formatter &fmt) |
Used for printing values with formatting. | |
WithFormatter | operator+ (Formatter &fmt) |
Used for printing values with formatting. | |
WithFormatter | operator+ (const std::string &linePrefix) |
Used for printing values with formatting. | |
virtual size_t | get_width () const |
Virtual API. | |
virtual std::string | get_comment () const |
Some subclasses support the ability to add comments to values. | |
virtual void | set_comment (const std::string &) const |
Some subclasses support the ability to add comments to values. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Public Member Functions inherited from Sawyer::SharedFromThis< SValue > | |
SharedPointer< SValue > | sharedFromThis () |
Create a shared pointer from this . | |
SharedPointer< const SValue > | sharedFromThis () const |
Create a shared pointer from this . | |
Static Public Member Functions | |
static uint64_t | nextName () |
Returns the next available name. | |
static SValuePtr | instance () |
Instantiate a new prototypical value. | |
static SValuePtr | instance (size_t nbits) |
Instantiate a new undefined value of specified width. | |
static SValuePtr | instance (size_t nbits, uint64_t value) |
Instantiate a new concrete value. | |
static SValuePtr | instance (size_t nbits, uint64_t name, uint64_t offset, bool negate) |
Insantiate a new value with all the necessary parts. | |
static SValuePtr | promote (const BaseSemantics::SValuePtr &) |
Promote a base value to a PartialSymbolicSemantics value. | |
Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue | |
static SValuePtr | promote (const SValuePtr &x) |
Static Public Member Functions inherited from Sawyer::SmallObject | |
static SynchronizedPoolAllocator & | poolAllocator () |
Return the pool allocator for this class. | |
static void * | operator new (size_t size) |
static void | operator delete (void *ptr, size_t size) |
Public Attributes | |
uint64_t | name |
Zero for constants; non-zero ID number for everything else. | |
uint64_t | offset |
The constant (if name==0) or an offset w.r.t. | |
bool | negate |
Switch between name+offset and (-name)+offset; should be false for constants. | |
Protected Member Functions | |
SValue (size_t nbits) | |
SValue (size_t nbits, uint64_t number) | |
SValue (size_t nbits, uint64_t name, uint64_t offset, bool negate) | |
Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue | |
SValue (size_t nbits) | |
SValue (const SValue &other) | |
Additional Inherited Members | |
Protected Attributes inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue | |
size_t | width |
using Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::SValue::Super = BaseSemantics::SValue |
Base type.
Definition at line 64 of file PartialSymbolicSemantics.h.
Shared-ownership pointer.
Definition at line 67 of file PartialSymbolicSemantics.h.
|
static |
Returns the next available name.
Returns the next available name and increments it.
Thread safety: This function is thread safe.
|
static |
Instantiate a new prototypical value.
Prototypical values are only used for their virtual constructors.
|
overridevirtual |
Data-flow bottom value.
Returns a new value that represents bottom in a data-flow analysis. If a semantic domain can represent a bottom value then the isBottom predicate is true when invoked on this method's return value. If a semantic domain cannot support a bottom value, then it may return some other value.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Create a new undefined semantic value.
The new semantic value will have the same dynamic type as the value on which this virtual method is called. This is the most common way that a new value is created. The unspecified_ method is closely related.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Create a new unspecified semantic value.
The new semantic value will have the same dynamic type as the value on which this virtual method is called. Undefined (undefined_) and unspecified are closely related. Unspecified values are the same as undefined values except they're instantiated as the result of some machine instruction where the ISA documentation indicates that the value is unspecified (e.g., status flags for x86 shift and rotate instructions).
Most semantic domains make no distinction between undefined and unspecified.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Create a new concrete semantic value.
The new value will represent the specified concrete value and have the same dynamic type as the value on which this virtual method is called. This is the most common way that a new constant is created. The number
is truncated to contain nbits
bits (higher order bits are cleared).
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Create a new value from an existing value, changing the width if new_width
is non-zero.
Increasing the width logically adds zero bits to the most significant side of the value; decreasing the width logically removes bits from the most significant side of the value.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Possibly create a new value by merging two existing values.
This method optionally returns a new semantic value as the data-flow merge of this
and other
. If the two inputs are "equal" in some sense of the dataflow implementation then nothing is returned, otherwise a new value is returned. Typical usage is like this:
If you always want a copy regardless of whether the merge is necessary, then use the createMerged convenience function instead.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
virtual |
Virtual allocating constructor.
Creates a new semantic value with full control over all aspects of the value.
|
static |
Promote a base value to a PartialSymbolicSemantics value.
The value v
must have a PartialSymbolicSemantics::SValue dynamic type.
|
overridevirtual |
Hash this semantic value.
Hashes the value by appending it to the specified hasher.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Print a value to a stream using default format.
The value will normally occupy a single line and not contain leading space or line termination. See also, with_format().
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
inlineoverridevirtual |
Determines whether a value is a data-flow bottom.
Returns true if this value represents a bottom value for data-flow analysis. Any RiscOperation performed on an operand whose isBottom predicate returns true will itself return a bottom value. This includes operations like "xor x x" which would normally return zero.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
Definition at line 133 of file PartialSymbolicSemantics.h.
|
overridevirtual |
Virtual API.
See nBits.
Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Virtual API.
See mayEqual.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
overridevirtual |
Virtual API.
See mustEqual.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
|
inlineoverridevirtual |
Virtual API.
See isConcrete.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
Definition at line 154 of file PartialSymbolicSemantics.h.
References name.
Referenced by get_number().
|
inlineoverridevirtual |
Virtual API.
See toUnsigned and toSigned.
Implements Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SValue.
Definition at line 159 of file PartialSymbolicSemantics.h.
References is_number(), and offset.
uint64_t Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::SValue::name |
Zero for constants; non-zero ID number for everything else.
Definition at line 70 of file PartialSymbolicSemantics.h.
Referenced by is_number().
uint64_t Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::SValue::offset |
The constant (if name==0) or an offset w.r.t.
an unknown (named) base value.
Definition at line 71 of file PartialSymbolicSemantics.h.
Referenced by get_number().
bool Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::SValue::negate |
Switch between name+offset and (-name)+offset; should be false for constants.
Definition at line 72 of file PartialSymbolicSemantics.h.