ROSE  0.11.31.0
IntervalSemantics2.h
1 #ifndef Rose_IntervalSemantics_H
2 #define Rose_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 "BaseSemantics2.h"
14 #include "integerOps.h"
15 #include "RegisterStateGeneric.h"
16 #include "MemoryCellList.h"
17 
18 namespace Rose {
19 namespace BinaryAnalysis { // documented elsewhere
20 namespace InstructionSemantics2 { // documented elsewhere
21 
22 
24 namespace IntervalSemantics {
25 
26 /* Single contiguous interval. */
28 
31 
33 // Semantic values
35 
38 
41 protected:
42  Intervals intervals_;
43  bool isBottom_;
44 
45 protected:
46  // Protected constructors. See base class and public members for documentation
47  explicit SValue(size_t nbits):
48  BaseSemantics::SValue(nbits), isBottom_(false){
49  intervals_.insert(Interval::hull(0, IntegerOps::genMask<uint64_t>(nbits)));
50  }
51  SValue(size_t nbits, uint64_t number)
52  : BaseSemantics::SValue(nbits), isBottom_(false) {
53  number &= IntegerOps::genMask<uint64_t>(nbits);
54  intervals_.insert(number);
55  }
56  SValue(size_t nbits, uint64_t v1, uint64_t v2):
57  BaseSemantics::SValue(nbits), isBottom_(false) {
58  v1 &= IntegerOps::genMask<uint64_t>(nbits);
59  v2 &= IntegerOps::genMask<uint64_t>(nbits);
60  ASSERT_require(v1<=v2);
61  intervals_.insert(Interval::hull(v1, v2));
62  }
63  SValue(size_t nbits, const Intervals &intervals):
64  BaseSemantics::SValue(nbits), isBottom_(false) {
65  ASSERT_require(!intervals.isEmpty());
66  ASSERT_require((intervals.greatest() <= IntegerOps::genMask<uint64_t>(nbits)));
67  intervals_ = intervals;
68  }
69 
71  // Static allocating constructors
72 public:
74  static SValuePtr instance() {
75  return SValuePtr(new SValue(1));
76  }
77 
79  static SValuePtr instance_bottom(size_t nbits) {
80  SValue *self = new SValue(nbits);
81  self->isBottom_ = true;
82  return SValuePtr(self);
83  }
84 
87  static SValuePtr instance_undefined(size_t nbits) {
88  return SValuePtr(new SValue(nbits));
89  }
90 
95  static SValuePtr instance_unspecified(size_t nbits) {
96  return SValuePtr(new SValue(nbits));
97  }
98 
100  static SValuePtr instance_integer(size_t nbits, uint64_t number) {
101  return SValuePtr(new SValue(nbits, number));
102  }
103 
105  static SValuePtr instance_intervals(size_t nbits, const Intervals &intervals) {
106  return SValuePtr(new SValue(nbits, intervals));
107  }
108 
110  static SValuePtr instance_hull(size_t nbits, uint64_t v1, uint64_t v2) {
111  return SValuePtr(new SValue(nbits, v1, v2));
112  }
113 
115  static SValuePtr instance_copy(const SValuePtr &other) {
116  return SValuePtr(new SValue(*other));
117  }
118 
120  static SValuePtr instance_from_bits(size_t nbits, uint64_t possible_bits);
121 
123  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
124  SValuePtr retval = v.dynamicCast<SValue>();
125  ASSERT_not_null(retval);
126  return retval;
127  }
128 
130  // Virtual allocating constructors inherited from the super class
131 public:
132  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
133  return instance_bottom(nbits);
134  }
135  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
136  return instance_undefined(nbits);
137  }
138  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
139  return instance_unspecified(nbits);
140  }
141 
142  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t number) const ROSE_OVERRIDE {
143  return instance_integer(nbits, number);
144  }
145  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
146  SValuePtr retval(new SValue(*this));
147  if (new_width!=0 && new_width!=retval->nBits())
148  retval->set_width(new_width);
149  return retval;
150  }
151 
154  const SmtSolverPtr&) const ROSE_OVERRIDE;
155 
157  // Virtual allocating constructors first defined at this level of the class hierarchy
158 public:
160  virtual SValuePtr create(size_t nbits, uint64_t v1, uint64_t v2) {
161  return instance_hull(nbits, v1, v2);
162  }
163 
166  virtual SValuePtr create(size_t nbits, const Intervals &intervals) {
167  return instance_intervals(nbits, intervals);
168  }
169 
173  virtual SValuePtr create_from_bits(size_t nbits, uint64_t possible_bits) {
174  return instance_from_bits(nbits, possible_bits);
175  }
176 
177 
179  // Override virtual methods...
180 public:
181  virtual void hash(Combinatorics::Hasher&) const override;
182 
183  virtual bool isBottom() const ROSE_OVERRIDE {
184  return isBottom_;
185  }
186 
187  virtual void print(std::ostream &output, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
188 
190  // Override legacy methods. Override these, but always call the camelCase versions from BaseSemantics::SValue. These
191  // snake_case names may eventually go away, so be sure to make good use of "override" in your own code.
192 public:
193  // See mayEqual
194  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
195  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
196 
197  // See mustEqual
198  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
199  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
200 
201  // See isConcrete
202  virtual bool is_number() const ROSE_OVERRIDE {
203  return 1==intervals_.size();
204  }
205 
206  // See toUnsigned and toSigned
207  virtual uint64_t get_number() const ROSE_OVERRIDE {
208  ASSERT_require(1==intervals_.size());
209  return intervals_.least();
210  }
211 
213  // Additional methods introduced at this level of the class hierarchy
214 public:
216  const Intervals& get_intervals() const {
217  return intervals_;
218  }
219 
221  void set_intervals(const Intervals &intervals) {
222  intervals_ = intervals;
223  }
224 
226  uint64_t possible_bits() const;
227 
228 };
229 
230 
232 // Register state
234 
235 typedef BaseSemantics::RegisterStateGeneric RegisterState;
236 typedef BaseSemantics::RegisterStateGenericPtr RegisterStateGenericPtr;
237 
238 
240 // Memory state
242 
244 typedef boost::shared_ptr<class MemoryState> MemoryStatePtr;
245 
257 
259  // Real constructors
260 protected:
261  MemoryState(const BaseSemantics::MemoryCellPtr &protocell)
262  : BaseSemantics::MemoryCellList(protocell) {}
263 
264  MemoryState(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
265  : BaseSemantics::MemoryCellList(addrProtoval, valProtoval) {}
266 
267  MemoryState(const MemoryState &other)
269 
271  // Static allocating constructors
272 public:
274  static MemoryStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell) {
275  return MemoryStatePtr(new MemoryState(protocell));
276  }
277 
280  static MemoryStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) {
281  return MemoryStatePtr(new MemoryState(addrProtoval, valProtoval));
282  }
283 
285  // Virtual constructors
286 public:
287  virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::MemoryCellPtr &protocell) const ROSE_OVERRIDE {
288  return instance(protocell);
289  }
290 
292  const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE {
293  return instance(addrProtoval, valProtoval);
294  }
295 
296  virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE {
297  return MemoryStatePtr(new MemoryState(*this));
298  }
299 
301  // Methods we inherited
302 public:
308  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
309 
315  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
316 
320  virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value,
321  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
322 };
323 
324 
326 // Complete state
328 
329 typedef BaseSemantics::State State;
330 typedef BaseSemantics::StatePtr StatePtr;
331 
332 
334 // RISC operators
336 
338 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
339 
343  // Real constructors
344 protected:
346  : BaseSemantics::RiscOperators(protoval, solver) {
347  name("Interval");
348  (void) SValue::promote(protoval); // make sure its dynamic type is an IntervalSemantics::SValue or subclass thereof
349  }
350 
351  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
353  name("Interval");
354  (void) SValue::promote(state->protoval()); // dynamic type must be IntervalSemantics::SValue or subclass thereof
355  };
356 
358  // Static allocating constructors
359 public:
362  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
364  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
365  BaseSemantics::MemoryStatePtr memory = MemoryState::instance(protoval, protoval);
366  BaseSemantics::StatePtr state = State::instance(registers, memory);
367  return RiscOperatorsPtr(new RiscOperators(state, solver));
368  }
369 
372  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
373  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
374  }
375 
378  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
379  return RiscOperatorsPtr(new RiscOperators(state, solver));
380  }
381 
383  // Virtual constructors
384 public:
386  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
387  return instance(protoval, solver);
388  }
389 
391  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
392  return instance(state, solver);
393  }
394 
396  // Dynamic pointer casts
397 public:
400  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
401  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
402  ASSERT_not_null(retval);
403  return retval;
404  }
405 
407  // Methods first introduced at this level of the class hierarchy.
408 public:
409 
412  virtual SValuePtr svalue_from_bits(size_t nbits, uint64_t possible_bits) {
413  return SValue::promote(protoval())->create_from_bits(nbits, possible_bits);
414  }
415 
418  virtual SValuePtr svalue_from_intervals(size_t nbits, const Intervals &intervals) {
419  return SValue::promote(protoval())->create(nbits, intervals);
420  }
421 
423  // Override methods from base class. These are the RISC operators that are invoked by a Dispatcher.
424 public:
425  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
426  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
428  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
429  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
430  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
431  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
432  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
433  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
434  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
435  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
436  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
437  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
438  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
439  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
440  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
441  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
442  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
443  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
444  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
445  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
446  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
447  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
448  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
449  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
450  const BaseSemantics::SValuePtr &a_,
451  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
452  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
453  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
455  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
457  const BaseSemantics::SValuePtr &b_,
458  const BaseSemantics::SValuePtr &c_,
459  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
460  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
462  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
464  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
466  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
468  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
470  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
472  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
474  const BaseSemantics::SValuePtr &addr,
475  const BaseSemantics::SValuePtr &dflt,
476  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
478  const BaseSemantics::SValuePtr &addr,
479  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
480  virtual void writeMemory(RegisterDescriptor segreg,
481  const BaseSemantics::SValuePtr &addr,
482  const BaseSemantics::SValuePtr &data,
483  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
484 };
485 
486 } // namespace
487 } // namespace
488 } // namespace
489 } // namespace
490 
491 #endif
492 #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.
boost::shared_ptr< class MemoryCell > MemoryCellPtr
Shared-ownership pointer to a semantic memory cell.
Definition: MemoryCell.h:17
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.
bool isEmpty() const
Determine whether the container is empty.
Definition: IntervalSet.h:299
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:150
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.
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.
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:38
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.
Scalar greatest() const
Returns the maximum scalar contained in this set.
Definition: IntervalSet.h:414
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.
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.