ROSE  0.11.145.0
StaticSemantics.h
1 // Turn instruction semantics into part of the AST
2 #ifndef ROSE_BinaryAnalysis_InstructionSemantics_StaticSemantics_H
3 #define ROSE_BinaryAnalysis_InstructionSemantics_StaticSemantics_H
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 #include <Rose/BinaryAnalysis/Disassembler/BasicTypes.h>
9 #include <Rose/BinaryAnalysis/InstructionSemantics/NullSemantics.h>
10 #include "SageBuilderAsm.h"
11 
12 namespace Rose {
13 namespace BinaryAnalysis { // documented elsewhere
14 namespace InstructionSemantics { // documented elsewhere
15 
40 namespace StaticSemantics {
41 
43 // Free functions
45 
61 // Value type
64 
67 
76 public:
79 
81  using Ptr = SValuePtr;
82 
83 protected:
84  SgAsmExpression *ast_;
85 
86 protected:
87  SValue(size_t nbits, SgAsmRiscOperation::RiscOperator op): BaseSemantics::SValue(nbits) {
88  static uint64_t nVars = 0;
89  ast_ = SageBuilderAsm::buildRiscOperation(op, SageBuilderAsm::buildValueU64(nVars++));
90  }
91 
92  SValue(size_t nbits, uint64_t number): BaseSemantics::SValue(nbits) {
93  SgAsmType *type = SgAsmType::registerOrDelete(new SgAsmIntegerType(ByteOrder::ORDER_LSB, nbits,
94  false /*unsigned*/));
95  ast_ = SageBuilderAsm::buildValueInteger(number, type);
96  }
97 
98  SValue(const SValue &other): BaseSemantics::SValue(other) {
99  SgTreeCopy deep;
100  SgNode *copied = other.ast_->copy(deep);
101  ASSERT_require(isSgAsmExpression(copied));
102  ast_ = isSgAsmExpression(copied);
103  }
104 
105 public:
109  static SValuePtr instance() {
110  return SValuePtr(new SValue(1, SgAsmRiscOperation::OP_undefined));
111  }
112 
114  static SValuePtr instance_bottom(size_t nbits) {
115  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_bottom));
116  }
117 
123  static SValuePtr instance_undefined(size_t nbits) {
124  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_undefined));
125  }
126 
132  static SValuePtr instance_unspecified(size_t nbits) {
133  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_unspecified));
134  }
135 
137  static SValuePtr instance_integer(size_t nbits, uint64_t value) {
138  return SValuePtr(new SValue(nbits, value));
139  }
140 
141 public:
142  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const override {
143  return instance_bottom(nbits);
144  }
145  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const override {
146  return instance_undefined(nbits);
147  }
148  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const override {
149  return instance_unspecified(nbits);
150  }
151  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const override {
152  return instance_integer(nbits, value);
153  }
154  virtual BaseSemantics::SValuePtr boolean_(bool value) const override {
155  return instance_integer(1, value ? 1 : 0);
156  }
157  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const override {
158  SValuePtr retval(new SValue(*this));
159  if (new_width!=0 && new_width!=retval->nBits())
160  retval->set_width(new_width);
161  return retval;
162  }
165  const SmtSolverPtr&) const override {
166  throw BaseSemantics::NotImplemented("StaticSemantics is not suitable for dataflow analysis", NULL);
167  }
168 
169 public:
171  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
172  SValuePtr retval = v.dynamicCast<SValue>();
173  ASSERT_not_null(retval);
174  return retval;
175  }
176 
177 public:
178  // These are not needed since this domain never tries to compare semantic values.
179  virtual bool may_equal(const BaseSemantics::SValuePtr &/*other*/,
180  const SmtSolverPtr& = SmtSolverPtr()) const override {
181  ASSERT_not_reachable("no implementation necessary");
182  }
183 
184  virtual bool must_equal(const BaseSemantics::SValuePtr &/*other*/,
185  const SmtSolverPtr& = SmtSolverPtr()) const override {
186  ASSERT_not_reachable("no implementation necessary");
187  }
188 
189  virtual void set_width(size_t /*nbits*/) override {
190  ASSERT_not_reachable("no implementation necessary");
191  }
192 
193  virtual bool isBottom() const override {
194  return false;
195  }
196 
197  virtual bool is_number() const override {
198  return false;
199  }
200 
201  virtual uint64_t get_number() const override {
202  ASSERT_not_reachable("no implementation necessary");
203  }
204 
205  virtual void hash(Combinatorics::Hasher&) const override {
206  ASSERT_not_reachable("no implementation necessary");
207  }
208 
209  virtual void print(std::ostream&, BaseSemantics::Formatter&) const override;
210 
211 public:
215  virtual SgAsmExpression* ast() {
216  return ast_;
217  }
218  virtual void ast(SgAsmExpression *x) {
219  ASSERT_not_null(x);
220  ASSERT_require(x->get_parent() == NULL);
221  ast_ = x;
222  }
224 };
225 
227 // State
229 
230 // No state necessary for this domain. All instruction side effects are immediately attached to the SgAsmInstruction node
231 // rather than being stored in some state.
232 
233 typedef NullSemantics::RegisterState RegisterState;
234 typedef NullSemantics::RegisterStatePtr RegisterStatePtr;
235 
236 typedef NullSemantics::MemoryState MemoryState;
237 typedef NullSemantics::MemoryStatePtr MemoryStatePtr;
238 
239 typedef NullSemantics::State State;
240 typedef NullSemantics::StatePtr StatePtr;
241 
242 
244 // RiscOperators
246 
248 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
249 
261 public:
264 
267 
268 protected:
270 
272 
273 public:
274  ~RiscOperators();
275 
278  static RiscOperatorsPtr instanceFromRegisters(const RegisterDictionaryPtr&, const SmtSolverPtr &solver = SmtSolverPtr());
279 
283  static RiscOperatorsPtr instanceFromProtoval(const BaseSemantics::SValuePtr &protoval,
284  const SmtSolverPtr &solver = SmtSolverPtr());
285 
288  static RiscOperatorsPtr instanceFromState(const BaseSemantics::StatePtr&, const SmtSolverPtr &solver = SmtSolverPtr());
289 
291  // Virtual constructors
292 public:
294  const SmtSolverPtr &solver = SmtSolverPtr()) const override;
295 
297  const SmtSolverPtr &solver = SmtSolverPtr()) const override;
298 
300  // Dynamic pointer casts
301 public:
304  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr&);
305 
307  // Supporting functions
308 protected:
319  const BaseSemantics::SValuePtr &a);
321  const BaseSemantics::SValuePtr &a,
322  const BaseSemantics::SValuePtr &b);
324  const BaseSemantics::SValuePtr &a,
325  const BaseSemantics::SValuePtr &b,
326  const BaseSemantics::SValuePtr &c);
328  const BaseSemantics::SValuePtr &a,
329  const BaseSemantics::SValuePtr &b,
330  const BaseSemantics::SValuePtr &c,
331  const BaseSemantics::SValuePtr &d);
341 
343  // Override all operator methods from base class. These are the RISC operators that are invoked by a Dispatcher.
344 public:
345  virtual void startInstruction(SgAsmInstruction*) override;
349  virtual void hlt() override;
350  virtual void cpuid() override;
351  virtual BaseSemantics::SValuePtr rdtsc() override;
353  const BaseSemantics::SValuePtr &b_) override;
355  const BaseSemantics::SValuePtr &b_) override;
357  const BaseSemantics::SValuePtr &b_) override;
358  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) override;
360  size_t begin_bit, size_t end_bit) override;
362  const BaseSemantics::SValuePtr &b_) override;
366  const BaseSemantics::SValuePtr &sa_) override;
368  const BaseSemantics::SValuePtr &sa_) override;
370  const BaseSemantics::SValuePtr &sa_) override;
372  const BaseSemantics::SValuePtr &sa_) override;
374  const BaseSemantics::SValuePtr &sa_) override;
377  const BaseSemantics::SValuePtr &a_,
378  const BaseSemantics::SValuePtr &b_,
379  IteStatus&) override;
383  const BaseSemantics::SValuePtr&) override;
385  const BaseSemantics::SValuePtr&) override;
387  const BaseSemantics::SValuePtr&) override;
389  const BaseSemantics::SValuePtr&) override;
391  const BaseSemantics::SValuePtr&) override;
393  const BaseSemantics::SValuePtr&) override;
395  const BaseSemantics::SValuePtr&) override;
397  const BaseSemantics::SValuePtr&) override;
398  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) override;
399  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) override;
401  const BaseSemantics::SValuePtr &b_) override;
403  const BaseSemantics::SValuePtr &b_) override;
405  const BaseSemantics::SValuePtr &b_,
406  const BaseSemantics::SValuePtr &c_,
407  BaseSemantics::SValuePtr &carry_out/*out*/) override;
408  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) override;
410  const BaseSemantics::SValuePtr &b_) override;
412  const BaseSemantics::SValuePtr &b_) override;
414  const BaseSemantics::SValuePtr &b_) override;
416  const BaseSemantics::SValuePtr &b_) override;
418  const BaseSemantics::SValuePtr &b_) override;
420  const BaseSemantics::SValuePtr &b_) override;
421  virtual void interrupt(int majr, int minr) override;
423  const BaseSemantics::SValuePtr &dflt) override;
425  const BaseSemantics::SValuePtr &dflt) override;
426  virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a) override;
428  const BaseSemantics::SValuePtr &addr,
429  const BaseSemantics::SValuePtr &dflt,
430  const BaseSemantics::SValuePtr &cond) override;
432  const BaseSemantics::SValuePtr &addr,
433  const BaseSemantics::SValuePtr &dflt) override;
434  virtual void writeMemory(RegisterDescriptor segreg,
435  const BaseSemantics::SValuePtr &addr,
436  const BaseSemantics::SValuePtr &data,
437  const BaseSemantics::SValuePtr &cond) override;
438 };
439 
440 
441 } // namespace
442 } // namespace
443 } // namespace
444 } // namespace
445 
446 #endif
447 #endif
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) override
Two's complement.
virtual void startInstruction(SgAsmInstruction *) override
Called at the beginning of every instruction.
static SValuePtr instance_undefined(size_t nbits)
Instantiate an undefined value.
virtual BaseSemantics::SValuePtr isUnsignedLessThan(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for unsigned values.
static SValuePtr instance()
Instantiate a prototypical SValue.
virtual bool isBottom() const override
Determines whether a value is a data-flow bottom.
virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
Rotate bits to the right.
virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const override
Create a new unspecified semantic value.
virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) override
Returns position of most significant set bit; zero when no bits are set.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual BaseSemantics::SValuePtr filterIndirectJumpTarget(const BaseSemantics::SValuePtr &a) override
Invoked to filter indirect jumps.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
Obtain a register value without side effects.
Base class for machine instructions.
virtual BaseSemantics::SValuePtr isEqual(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Equality comparison.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Divides two signed values.
RiscOperator
One enum per RISC operator.
static RiscOperatorsPtr instanceFromRegisters(const RegisterDictionaryPtr &, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object and configures it to use semantic values and states that are ...
virtual BaseSemantics::SValuePtr isSignedGreaterThanOrEqual(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for signed values.
virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) override
One's complement.
Semantic values for generating static semantic ASTs.
virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Computes bit-wise OR of two values.
virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
Rotate bits to the left.
Holds a value or nothing.
Definition: Optional.h:49
virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) override
Returns position of least significant set bit; zero when no bits are set.
static SValuePtr instance_integer(size_t nbits, uint64_t value)
Instantiate an integer constant.
virtual BaseSemantics::SValuePtr isUnsignedGreaterThanOrEqual(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for unsigned values.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a) override
Writes a value to a register.
Main namespace for the ROSE library.
virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) override
Determines whether a value is equal to zero.
virtual BaseSemantics::SValuePtr rdtsc() override
Invoked for the x86 RDTSC instruction.
virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_, size_t begin_bit, size_t end_bit) override
Extracts bits from a value.
virtual BaseSemantics::SValuePtr isSignedGreaterThan(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for signed values.
virtual BaseSemantics::SValuePtr isSignedLessThan(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for signed values.
static RiscOperatorsPtr instanceFromProtoval(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified prototypical values.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
virtual BaseSemantics::SValuePtr isUnsignedLessThanOrEqual(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for unsigned values.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer.
virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
Returns arg shifted right arithmetically (with sign bit).
virtual uint64_t get_number() const override
Virtual API.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
virtual void cpuid() override
Invoked for the x86 CPUID instruction.
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.
boost::shared_ptr< class RegisterState > RegisterStatePtr
Shared-ownership pointer.
virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Computes bit-wise XOR of two values.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Multiplies two signed values.
virtual BaseSemantics::SValuePtr filterCallTarget(const BaseSemantics::SValuePtr &a) override
Invoked to filter call targets.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Divides two unsigned values.
static Type * registerOrDelete(Type *toInsert)
Registers a type with the type system.
virtual BaseSemantics::SValuePtr isSignedLessThanOrEqual(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for signed values.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &)
Run-time promotion of a base RiscOperators pointer to static operators.
virtual void interrupt(int majr, int minr) override
Invoked for instructions that cause an interrupt.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer for basic semantic operations.
Describes (part of) a physical CPU register.
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:9846
virtual void ast(SgAsmExpression *x)
Property: Abstract syntax tree.
virtual BaseSemantics::SValuePtr isNotEqual(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Equality comparison.
virtual BaseSemantics::SValuePtr iteWithStatus(const BaseSemantics::SValuePtr &sel_, const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, IteStatus &) override
If-then-else with status.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) override
Read memory without side effects.
virtual BaseSemantics::SValuePtr filterReturnTarget(const BaseSemantics::SValuePtr &a) override
Invoked to filter return targets.
virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) override
Sign extends a value.
virtual SgAsmExpression * ast()
Property: Abstract syntax tree.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
Reads a value from a register.
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for expressions.
virtual BaseSemantics::SValuePtr boolean_(bool value) const override
Create a new, Boolean value.
virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) override
Add two values of equal size and a carry bit.
virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, const BaseSemantics::SValuePtr &cond) override
Reads a value from memory.
virtual Sawyer::Optional< BaseSemantics::SValuePtr > createOptionalMerge(const BaseSemantics::SValuePtr &, const BaseSemantics::MergerPtr &, const SmtSolverPtr &) const override
Possibly create a new value by merging two existing values.
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer for a static-semantics value.
virtual SgNode * copy(SgCopyHelp &help) const
This function clones the current IR node object recursively or not, depending on the argument...
Supporting class for "Deep" copies of the AST.
Definition: Cxx_Grammar.h:9707
Base class for binary types.
void saveSemanticEffect(const BaseSemantics::SValuePtr &)
Save instruction side effect.
virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Adds two integers of equal size.
virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const override
Create a new undefined semantic value.
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
Returns arg shifted left.
SgNode * get_parent() const
Access function for parent node.
virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) override
Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits...
virtual void hlt() override
Invoked for the x86 HLT instruction.
std::shared_ptr< SmtSolver > SmtSolverPtr
Reference counting pointer.
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to a static semantics value.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const override
Create a new concrete semantic value.
virtual BaseSemantics::SValuePtr isUnsignedGreaterThan(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) override
Comparison for unsigned values.
virtual void hash(Combinatorics::Hasher &) const override
Hash this semantic value.
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Calculates modulo with signed values.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) override
Writes a value to memory.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const override
Data-flow bottom value.
Base class for most instruction semantics RISC operators.
Definition: RiscOperators.h:49
virtual bool may_equal(const BaseSemantics::SValuePtr &, const SmtSolverPtr &=SmtSolverPtr()) const override
Virtual API.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Multiply two unsigned values.
virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Concatenates the bits of two values.
Base class for semantics machine states.
Definition: State.h:39
void attachInstructionSemantics(SgNode *ast, const Disassembler::BasePtr &)
Build and attach static semantics to all instructions.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const override
Virtual allocating constructor.
virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
Returns arg shifted right logically (no sign bit).
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Calculates modulo with unsigned values.
virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Computes bit-wise AND of two values.
static RiscOperatorsPtr instanceFromState(const BaseSemantics::StatePtr &, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified state.
virtual BaseSemantics::SValuePtr subtract(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
Subtract one value from another.
virtual bool must_equal(const BaseSemantics::SValuePtr &, const SmtSolverPtr &=SmtSolverPtr()) const override
Virtual API.
static SValuePtr instance_bottom(size_t nbits)
Instantiate a data-flow bottom value.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const override
Print a value to a stream using default format.
BaseSemantics::SValuePtr makeSValue(size_t nbits, SgAsmExpression *)
Create a new SValue.
static SValuePtr instance_unspecified(size_t nbits)
Instantiate an unspecified value.