ROSE  0.11.50.0
IntervalSemantics.h
1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics2_IntervalSemantics_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics2_IntervalSemantics_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <stdint.h>
7 
8 #ifndef __STDC_FORMAT_MACROS
9 #define __STDC_FORMAT_MACROS
10 #endif
11 #include <inttypes.h>
12 
13 #include <Rose/BinaryAnalysis/InstructionSemantics2/BaseSemantics.h>
14 #include "integerOps.h"
15 
16 namespace Rose {
17 namespace BinaryAnalysis { // documented elsewhere
18 namespace InstructionSemantics2 { // documented elsewhere
19 
20 
22 namespace IntervalSemantics {
23 
24 /* Single contiguous interval. */
26 
29 
31 // Semantic values
33 
36 
39 public:
42 
44  using Ptr = SValuePtr;
45 
46 protected:
47  Intervals intervals_;
48  bool isBottom_;
49 
50 protected:
51  // Protected constructors. See base class and public members for documentation
52  explicit SValue(size_t nbits):
53  BaseSemantics::SValue(nbits), isBottom_(false){
54  intervals_.insert(Interval::hull(0, IntegerOps::genMask<uint64_t>(nbits)));
55  }
56  SValue(size_t nbits, uint64_t number)
57  : BaseSemantics::SValue(nbits), isBottom_(false) {
58  number &= IntegerOps::genMask<uint64_t>(nbits);
59  intervals_.insert(number);
60  }
61  SValue(size_t nbits, uint64_t v1, uint64_t v2):
62  BaseSemantics::SValue(nbits), isBottom_(false) {
63  v1 &= IntegerOps::genMask<uint64_t>(nbits);
64  v2 &= IntegerOps::genMask<uint64_t>(nbits);
65  ASSERT_require(v1<=v2);
66  intervals_.insert(Interval::hull(v1, v2));
67  }
68  SValue(size_t nbits, const Intervals &intervals):
69  BaseSemantics::SValue(nbits), isBottom_(false) {
70  ASSERT_require(!intervals.isEmpty());
71  ASSERT_require((intervals.greatest() <= IntegerOps::genMask<uint64_t>(nbits)));
72  intervals_ = intervals;
73  }
74 
76  // Static allocating constructors
77 public:
79  static SValuePtr instance() {
80  return SValuePtr(new SValue(1));
81  }
82 
84  static SValuePtr instance_bottom(size_t nbits) {
85  SValue *self = new SValue(nbits);
86  self->isBottom_ = true;
87  return SValuePtr(self);
88  }
89 
92  static SValuePtr instance_undefined(size_t nbits) {
93  return SValuePtr(new SValue(nbits));
94  }
95 
100  static SValuePtr instance_unspecified(size_t nbits) {
101  return SValuePtr(new SValue(nbits));
102  }
103 
105  static SValuePtr instance_integer(size_t nbits, uint64_t number) {
106  return SValuePtr(new SValue(nbits, number));
107  }
108 
110  static SValuePtr instance_intervals(size_t nbits, const Intervals &intervals) {
111  return SValuePtr(new SValue(nbits, intervals));
112  }
113 
115  static SValuePtr instance_hull(size_t nbits, uint64_t v1, uint64_t v2) {
116  return SValuePtr(new SValue(nbits, v1, v2));
117  }
118 
120  static SValuePtr instance_copy(const SValuePtr &other) {
121  return SValuePtr(new SValue(*other));
122  }
123 
125  static SValuePtr instance_from_bits(size_t nbits, uint64_t possible_bits);
126 
128  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
129  SValuePtr retval = v.dynamicCast<SValue>();
130  ASSERT_not_null(retval);
131  return retval;
132  }
133 
135  // Virtual allocating constructors inherited from the super class
136 public:
137  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
138  return instance_bottom(nbits);
139  }
140  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
141  return instance_undefined(nbits);
142  }
143  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
144  return instance_unspecified(nbits);
145  }
146 
147  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t number) const ROSE_OVERRIDE {
148  return instance_integer(nbits, number);
149  }
150  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
151  SValuePtr retval(new SValue(*this));
152  if (new_width!=0 && new_width!=retval->nBits())
153  retval->set_width(new_width);
154  return retval;
155  }
156 
159  const SmtSolverPtr&) const ROSE_OVERRIDE;
160 
162  // Virtual allocating constructors first defined at this level of the class hierarchy
163 public:
165  virtual SValuePtr create(size_t nbits, uint64_t v1, uint64_t v2) {
166  return instance_hull(nbits, v1, v2);
167  }
168 
171  virtual SValuePtr create(size_t nbits, const Intervals &intervals) {
172  return instance_intervals(nbits, intervals);
173  }
174 
178  virtual SValuePtr create_from_bits(size_t nbits, uint64_t possible_bits) {
179  return instance_from_bits(nbits, possible_bits);
180  }
181 
182 
184  // Override virtual methods...
185 public:
186  virtual void hash(Combinatorics::Hasher&) const override;
187 
188  virtual bool isBottom() const ROSE_OVERRIDE {
189  return isBottom_;
190  }
191 
192  virtual void print(std::ostream &output, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
193 
195  // Override legacy methods. Override these, but always call the camelCase versions from BaseSemantics::SValue. These
196  // snake_case names may eventually go away, so be sure to make good use of "override" in your own code.
197 public:
198  // See mayEqual
199  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
200  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
201 
202  // See mustEqual
203  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
204  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
205 
206  // See isConcrete
207  virtual bool is_number() const ROSE_OVERRIDE {
208  return 1==intervals_.size();
209  }
210 
211  // See toUnsigned and toSigned
212  virtual uint64_t get_number() const ROSE_OVERRIDE {
213  ASSERT_require(1==intervals_.size());
214  return intervals_.least();
215  }
216 
218  // Additional methods introduced at this level of the class hierarchy
219 public:
221  const Intervals& get_intervals() const {
222  return intervals_;
223  }
224 
226  void set_intervals(const Intervals &intervals) {
227  intervals_ = intervals;
228  }
229 
231  uint64_t possible_bits() const;
232 
233 };
234 
235 
237 // Register state
239 
240 typedef BaseSemantics::RegisterStateGeneric RegisterState;
241 typedef BaseSemantics::RegisterStateGenericPtr RegisterStateGenericPtr;
242 
243 
245 // Memory state
247 
249 typedef boost::shared_ptr<class MemoryState> MemoryStatePtr;
250 
262 public:
265 
268 
270  // Real constructors
271 protected:
272  MemoryState(const BaseSemantics::MemoryCellPtr &protocell)
273  : BaseSemantics::MemoryCellList(protocell) {}
274 
275  MemoryState(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
276  : BaseSemantics::MemoryCellList(addrProtoval, valProtoval) {}
277 
278  MemoryState(const MemoryState &other)
279  : BaseSemantics::MemoryCellList(other) {}
280 
282  // Static allocating constructors
283 public:
285  static MemoryStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell) {
286  return MemoryStatePtr(new MemoryState(protocell));
287  }
288 
291  static MemoryStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) {
292  return MemoryStatePtr(new MemoryState(addrProtoval, valProtoval));
293  }
294 
296  // Virtual constructors
297 public:
298  virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::MemoryCellPtr &protocell) const ROSE_OVERRIDE {
299  return instance(protocell);
300  }
301 
303  const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE {
304  return instance(addrProtoval, valProtoval);
305  }
306 
307  virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE {
308  return MemoryStatePtr(new MemoryState(*this));
309  }
310 
312  // Methods we inherited
313 public:
319  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
320 
326  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
327 
331  virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value,
332  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
333 };
334 
335 
337 // Complete state
339 
340 typedef BaseSemantics::State State;
341 typedef BaseSemantics::StatePtr StatePtr;
342 
343 
345 // RISC operators
347 
349 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
350 
353 public:
356 
359 
361  // Real constructors
362 protected:
364  : BaseSemantics::RiscOperators(protoval, solver) {
365  name("Interval");
366  (void) SValue::promote(protoval); // make sure its dynamic type is an IntervalSemantics::SValue or subclass thereof
367  }
368 
369  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
370  : BaseSemantics::RiscOperators(state, solver) {
371  name("Interval");
372  (void) SValue::promote(state->protoval()); // dynamic type must be IntervalSemantics::SValue or subclass thereof
373  };
374 
376  // Static allocating constructors
377 public:
380  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
382  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
383  BaseSemantics::MemoryStatePtr memory = MemoryState::instance(protoval, protoval);
384  BaseSemantics::StatePtr state = State::instance(registers, memory);
385  return RiscOperatorsPtr(new RiscOperators(state, solver));
386  }
387 
390  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
391  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
392  }
393 
396  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
397  return RiscOperatorsPtr(new RiscOperators(state, solver));
398  }
399 
401  // Virtual constructors
402 public:
404  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
405  return instance(protoval, solver);
406  }
407 
409  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
410  return instance(state, solver);
411  }
412 
414  // Dynamic pointer casts
415 public:
418  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
419  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
420  ASSERT_not_null(retval);
421  return retval;
422  }
423 
425  // Methods first introduced at this level of the class hierarchy.
426 public:
427 
430  virtual SValuePtr svalue_from_bits(size_t nbits, uint64_t possible_bits) {
431  return SValue::promote(protoval())->create_from_bits(nbits, possible_bits);
432  }
433 
436  virtual SValuePtr svalue_from_intervals(size_t nbits, const Intervals &intervals) {
437  return SValue::promote(protoval())->create(nbits, intervals);
438  }
439 
441  // Override methods from base class. These are the RISC operators that are invoked by a Dispatcher.
442 public:
443  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
444  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
446  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
447  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
448  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
449  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
450  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
451  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
452  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
453  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
454  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
455  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
456  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
457  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
458  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
459  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
460  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
461  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
462  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
463  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
464  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
465  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
466  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
467  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
468  const BaseSemantics::SValuePtr &a_,
469  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
470  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
471  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
473  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
475  const BaseSemantics::SValuePtr &b_,
476  const BaseSemantics::SValuePtr &c_,
477  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
478  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
480  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
482  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
484  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
486  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
488  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
490  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
492  const BaseSemantics::SValuePtr &addr,
493  const BaseSemantics::SValuePtr &dflt,
494  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
496  const BaseSemantics::SValuePtr &addr,
497  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
498  virtual void writeMemory(RegisterDescriptor segreg,
499  const BaseSemantics::SValuePtr &addr,
500  const BaseSemantics::SValuePtr &data,
501  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
502 };
503 
504 } // namespace
505 } // namespace
506 } // namespace
507 } // namespace
508 
509 #endif
510 #endif
const Intervals & get_intervals() const
Returns the rangemap stored in this value.
static RegisterStateGenericPtr instance(const SValuePtr &protoval, const RegisterDictionary *regdict)
Instantiate a new register state.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two signed values.
virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE
Create a new undefined semantic value.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to interval operators.
virtual SValuePtr create(size_t nbits, uint64_t v1, uint64_t v2)
Construct a ValueType that's constrained to be between two unsigned values, inclusive.
boost::shared_ptr< class RegisterStateGeneric > RegisterStateGenericPtr
Shared-ownership pointer to generic register states.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::MemoryCellPtr &protocell) const ROSE_OVERRIDE
Virtual allocating constructor.
static SValuePtr instance_copy(const SValuePtr &other)
Instantiate a new copy of an existing value.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiply two unsigned values.
static SValuePtr instance_integer(size_t nbits, uint64_t number)
Instantiate a new concrete value of particular width.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
static SValuePtr instance_bottom(size_t nbits)
Instantiate a new data-flow-bottom value of specified width.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer to an interval memory state.
virtual uint64_t get_number() const ROSE_OVERRIDE
Virtual API.
Holds a value or nothing.
Definition: Optional.h:49
static MemoryStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
Instantiate a new memory state with prototypical value.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
static SValuePtr instance_hull(size_t nbits, uint64_t v1, uint64_t v2)
Instantiate a new value that's constrained to be between two unsigned values, inclusive.
virtual bool isBottom() const ROSE_OVERRIDE
Determines whether a value is a data-flow bottom.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two unsigned values.
virtual SValuePtr svalue_from_intervals(size_t nbits, const Intervals &intervals)
Create a new SValue from a set of intervals.
Main namespace for the ROSE library.
virtual bool may_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE
Data-flow bottom value.
virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE
Create a new value from an existing value, changing the width if new_width is non-zero.
virtual BaseSemantics::SValuePtr peekMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Read a byte from memory without side effects.
void insert(const Interval2 &interval)
Insert specified values.
Definition: IntervalSet.h:532
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
static SValuePtr instance_unspecified(size_t nbits)
Instantiate a new unspecified value of specific width.
virtual bool must_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
virtual void print(std::ostream &output, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a value to a stream using default format.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified prototypical value.
virtual Sawyer::Optional< BaseSemantics::SValuePtr > createOptionalMerge(const BaseSemantics::SValuePtr &other, const BaseSemantics::MergerPtr &, const SmtSolverPtr &) const ROSE_OVERRIDE
Possibly create a new value by merging two existing values.
static SValuePtr instance_intervals(size_t nbits, const Intervals &intervals)
Instantiate a new value from a set of intervals.
virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Reads a value from memory.
Describes (part of) a physical CPU register.
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with unsigned values.
static Interval hull(T v1, T v2)
Construct an interval from two endpoints.
Definition: Interval.h:151
static SValuePtr instance_undefined(size_t nbits)
Instantiate a new undefined value of particular width.
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Two's complement.
static SValuePtr instance()
Instantiate a new prototypical value.
Sawyer::Container::IntervalSet< Interval > Intervals
Set of intervals.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.
static MemoryStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell)
Instantiate a new memory state with specified prototypical cells and values.
void set_intervals(const Intervals &intervals)
Changes the rangemap stored in the value.
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for most instruction semantics RISC operators.
Definition: RiscOperators.h:48
boost::shared_ptr< MemoryCell > MemoryCellPtr
Shared-ownership pointer to a memory cell.
static SValuePtr instance_from_bits(size_t nbits, uint64_t possible_bits)
Create a value from a set of possible bits.
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to an IntevalSemantics value.
virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Write a byte to memory.
virtual SValuePtr create_from_bits(size_t nbits, uint64_t possible_bits)
Generate ranges from bits.
Scalar least() const
Returns the minimum scalar contained in this set.
Definition: IntervalSet.h:408
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer to an interval semantic value.
Range of values delimited by endpoints.
Definition: Interval.h:33
virtual void hash(Combinatorics::Hasher &) const override
Hash this semantic value.
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with signed values.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators with specified state.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t number) const ROSE_OVERRIDE
Create a new concrete semantic value.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiplies two signed values.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to interval RISC operations.
static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object and configures it to use semantic values and states that are ...
uint64_t possible_bits() const
Returns all possible bits that could be set.
Defines registers available for a particular architecture.
Definition: Registers.h:37
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
Interval::Value size() const
Number of scalar elements represented.
Definition: IntervalSet.h:308
virtual SValuePtr create(size_t nbits, const Intervals &intervals)
Construct a ValueType from a rangemap.
virtual const std::string & name() const
Property: Name used for debugging.
virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE
Create a new unspecified semantic value.
Type of values manipulated by the IntervalSemantics domain.
virtual BaseSemantics::SValuePtr readMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Read a byte from memory.
boost::shared_ptr< RegisterState > RegisterStatePtr
Shared-ownership pointer to a register state.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
Definition: SmtSolver.h:25
virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) ROSE_OVERRIDE
Used for printing RISC operators with formatting.
virtual SValuePtr svalue_from_bits(size_t nbits, uint64_t possible_bits)
Create a new SValue from a set of possible bits.