ROSE  0.11.31.0
PartialSymbolicSemantics2.h
1 #ifndef Rose_PartialSymbolicSemantics2_H
2 #define Rose_PartialSymbolicSemantics2_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #ifndef __STDC_FORMAT_MACROS
7 #define __STDC_FORMAT_MACROS
8 #endif
9 #include <inttypes.h>
10 
11 #include <map>
12 #include <stdint.h>
13 #include <vector>
14 
15 #include "rosePublicConfig.h"
16 #ifdef ROSE_HAVE_LIBGCRYPT
17 #include <gcrypt.h>
18 #endif
19 
20 #include "BaseSemantics2.h"
21 #include "integerOps.h"
22 #include "MemoryMap.h"
23 #include "FormatRestorer.h"
24 #include "RegisterStateGeneric.h"
25 #include "MemoryCellList.h"
26 
27 namespace Rose {
28 namespace BinaryAnalysis { // documented elsewhere
29 namespace InstructionSemantics2 { // documented elsewhere
30 
44 namespace PartialSymbolicSemantics {
45 
47 // Print formatter
49 
53 protected:
54  typedef std::map<uint64_t, uint64_t> Map;
55  Map renames;
56  size_t next_name;
57 public:
58  Formatter(): next_name(1) {}
59  uint64_t rename(uint64_t orig_name);
60 };
61 
62 
64 // Semantic values
66 
69 
73 public:
74  uint64_t name;
75  uint64_t offset;
76  bool negate;
78  // Real constructors
80 protected:
81  explicit SValue(size_t nbits)
82  : BaseSemantics::SValue(nbits), name(nextName()), offset(0), negate(false) {}
83 
84  SValue(size_t nbits, uint64_t number)
85  : BaseSemantics::SValue(nbits), name(0), offset(number), negate(false) {
86  if (nbits <= 64) {
87  this->offset &= IntegerOps::genMask<uint64_t>(nbits);
88  } else {
89  name = nextName();
90  offset = 0;
91  }
92  }
93 
94  SValue(size_t nbits, uint64_t name, uint64_t offset, bool negate)
95  : BaseSemantics::SValue(nbits), name(name), offset(offset), negate(negate) {
96  this->offset &= IntegerOps::genMask<uint64_t>(nbits);
97  ASSERT_require(nbits <= 64 || name != 0);
98  }
99 
100 public:
106  static uint64_t nextName();
107 
109  // Static allocating constructors
110 public:
112  static SValuePtr instance() {
113  return SValuePtr(new SValue(1));
114  }
115 
117  static SValuePtr instance(size_t nbits) {
118  return SValuePtr(new SValue(nbits));
119  }
120 
122  static SValuePtr instance(size_t nbits, uint64_t value) {
123  return SValuePtr(new SValue(nbits, value));
124  }
125 
127  static SValuePtr instance(size_t nbits, uint64_t name, uint64_t offset, bool negate) {
128  return SValuePtr(new SValue(nbits, name, offset, negate));
129  }
130 
132  // Virtual constructors
133 public:
134  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
135  return instance(nbits);
136  }
137  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
138  return instance(nbits);
139  }
140  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
141  return instance(nbits);
142  }
143 
144  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE {
145  return instance(nbits, value);
146  }
147 
148  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
149  SValuePtr retval(new SValue(*this));
150  if (new_width!=0 && new_width!=retval->nBits())
151  retval->set_width(new_width);
152  return retval;
153  }
154 
157  const SmtSolverPtr&) const ROSE_OVERRIDE;
158 
160  virtual BaseSemantics::SValuePtr create(size_t nbits, uint64_t name, uint64_t offset, bool negate) const {
161  return instance(nbits, name, offset, negate);
162  }
163 
165  // Dynamic pointer casts
166 public:
169  static SValuePtr promote(const BaseSemantics::SValuePtr &v) {
170  SValuePtr retval = v.dynamicCast<SValue>();
171  ASSERT_not_null(retval);
172  return retval;
173  }
174 
176  // Other stuff we inherited from the super class
177 public:
178  virtual void hash(Combinatorics::Hasher&) const override;
179  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
180 
181  virtual bool isBottom() const ROSE_OVERRIDE {
182  return false;
183  }
184 
186  // Override legacy members. These have similar non-virtual camelCase names in the base class, and eventually we'll remoe
187  // these snake_case names and change the camelCase names to be the virtual functions. Therefore, be sure to use "override"
188  // in your own code so you know when we make this change.
189 public:
190  // See nBits
191  virtual void set_width(size_t nbits) ROSE_OVERRIDE {
192  if (nbits > 64 && name == 0) {
193  *this = SValue(nbits);
194  } else {
195  ASSERT_require(nbits <= 64 || name != 0);
197  offset &= IntegerOps::genMask<uint64_t>(nbits);
198  }
199  }
200 
201  // See mayEqual
202  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
203  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
204 
205  // See mustEqual
206  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
207  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
208 
209  // See isConcrete
210  virtual bool is_number() const ROSE_OVERRIDE {
211  return 0==name;
212  }
213 
214  // See toUnsigned and toSigned.
215  virtual uint64_t get_number() const ROSE_OVERRIDE {
216  ASSERT_require(is_number());
217  return offset;
218  }
219 };
220 
221 
223 // Register state
225 
226 typedef BaseSemantics::RegisterStateGeneric RegisterState;
227 typedef BaseSemantics::RegisterStateGenericPtr RegisterStatePtr;
228 
229 
231 // Memory state
233 
234 // PartialSymbolicSemantics uses BaseSemantics::MemoryCellList (or subclass) as its memory state, and does not expect the
235 // MemoryCellList to be byte-restricted (i.e., the cells can store multi-byte values).
236 
237 typedef BaseSemantics::MemoryCellList MemoryState;
238 typedef BaseSemantics::MemoryCellListPtr MemoryStatePtr;
239 
240 
242 // Complete state
244 
246 typedef boost::shared_ptr<class State> StatePtr;
247 
250 class State: public BaseSemantics::State {
251 
253  // Real constructors
254 protected:
255  State(const BaseSemantics::RegisterStatePtr &registers,
256  const BaseSemantics::MemoryStatePtr &memory)
257  : BaseSemantics::State(registers, memory) {
258  // This state should use PartialSymbolicSemantics values (or subclasses thereof)
259  ASSERT_not_null(registers);
260  (void) SValue::promote(registers->protoval());
261  ASSERT_not_null(memory);
262  (void) SValue::promote(memory->get_addr_protoval());
263  (void) SValue::promote(memory->get_val_protoval());
264 
265  // This state should use a memory that is not byte restricted.
266  MemoryStatePtr mcl = MemoryState::promote(memory);
267  ASSERT_require(!mcl->byteRestricted());
268  }
269 
270  State(const State &other): BaseSemantics::State(other) {}
271 
273  // Static allocating constructors
274 public:
276  static StatePtr instance(const BaseSemantics::RegisterStatePtr &registers,
277  const BaseSemantics::MemoryStatePtr &memory) {
278  return StatePtr(new State(registers, memory));
279  }
280 
282  static StatePtr instance(const StatePtr &other) {
283  return StatePtr(new State(*other));
284  }
285 
287  // Virtual constructors
288 public:
289  virtual BaseSemantics::StatePtr create(const BaseSemantics::RegisterStatePtr &registers,
290  const BaseSemantics::MemoryStatePtr &memory) const ROSE_OVERRIDE {
291  return instance(registers, memory);
292  }
293 
294  virtual BaseSemantics::StatePtr clone() const ROSE_OVERRIDE {
295  StatePtr self = promote(boost::const_pointer_cast<BaseSemantics::State>(shared_from_this()));
296  return instance(self);
297  }
298 
300  // Dynamic pointer casts
301 public:
302  static StatePtr promote(const BaseSemantics::StatePtr &x) {
303  StatePtr retval = boost::dynamic_pointer_cast<State>(x);
304  ASSERT_not_null(x);
305  return retval;
306  }
307 
309  // Methods first declared at this level of the class hierarchy
310 public:
313  virtual void print_diff_registers(std::ostream&, const StatePtr &other_state, Formatter&) const;
314 
316  virtual bool equal_registers(const StatePtr &other) const;
317 
320  virtual void discard_popped_memory();
321 };
322 
323 
325 // RISC operators
327 
329 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
330 
333 protected:
334  MemoryMap::Ptr map;
335 
337  // Real constructors
338 protected:
340  : BaseSemantics::RiscOperators(protoval, solver) {
341  name("PartialSymbolic");
342  }
343  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
345  name("PartialSymbolic");
346  }
347 
349  // Static allocating constructors
350 public:
353  static RiscOperatorsPtr instance(const RegisterDictionary *regdict);
354 
356  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
357  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
358  }
359 
361  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
362  return RiscOperatorsPtr(new RiscOperators(state, solver));
363  }
364 
366  // Virtual constructors
367 public:
369  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
370  return instance(protoval, solver);
371  }
372 
374  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
375  return instance(state, solver);
376  }
377 
379  // Dynamic pointer casts
380 public:
383  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
384  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
385  ASSERT_not_null(retval);
386  return retval;
387  }
388 
390  // Methods first declared at this level of the class hierarchy
391 public:
396  const MemoryMap::Ptr get_memory_map() const { return map; }
397  void set_memory_map(const MemoryMap::Ptr &m) { map = m; }
400  // Risc operators inherited
402 public:
403  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
404  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
405  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
407  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
408  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
409  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
410  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
411  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
412  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
413  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
414  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
415  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
416  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
417  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
418  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
419  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
420  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
421  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
422  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
423  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
424  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
425  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
426  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
427  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
428  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
429  const BaseSemantics::SValuePtr &a_,
430  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
431  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
433  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
435  const BaseSemantics::SValuePtr &b_,
436  const BaseSemantics::SValuePtr &c_,
437  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
438  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
440  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
442  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
444  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
446  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
448  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
450  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
452  const BaseSemantics::SValuePtr &addr,
453  const BaseSemantics::SValuePtr &dflt,
454  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
456  const BaseSemantics::SValuePtr &addr,
457  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
458  virtual void writeMemory(RegisterDescriptor segreg,
459  const BaseSemantics::SValuePtr &addr,
460  const BaseSemantics::SValuePtr &data,
461  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
462 
463 protected:
464  BaseSemantics::SValuePtr readOrPeekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &address,
465  const BaseSemantics::SValuePtr &dflt_, bool allowSideEffects);
466 };
467 
468 } // namespace
469 } // namespace
470 } // namespace
471 } // namespace
472 
473 #endif
474 #endif
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with signed values.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE
Data-flow bottom value.
static RiscOperatorsPtr instance(const RegisterDictionary *regdict)
Instantiates a new RiscOperators object and configures it to use semantic values and states that are ...
boost::shared_ptr< class RegisterStateGeneric > RegisterStateGenericPtr
Shared-ownership pointer to generic register states.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two signed values.
virtual bool may_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE
Create a new unspecified semantic value.
virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE
Create a new undefined semantic value.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
Holds a value or nothing.
Definition: Optional.h:49
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer to a partial-symbolic semantic value.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiplies two signed values.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
Main namespace for the ROSE library.
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.
uint64_t name
Zero for constants; non-zero ID number for everything else.
virtual BaseSemantics::SValuePtr create(size_t nbits, uint64_t name, uint64_t offset, bool negate) const
Virtual allocating constructor.
static SValuePtr instance(size_t nbits)
Instantiate a new undefined value of specified width.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Two's complement.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiply two unsigned values.
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with unsigned values.
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.
bool negate
Switch between name+offset and (-name)+offset; should be false for constants.
Type of values manipulated by the PartialSymbolicSemantics domain.
virtual void interrupt(int majr, int minr) ROSE_OVERRIDE
Invoked for instructions that cause an interrupt.
boost::shared_ptr< class MemoryCellList > MemoryCellListPtr
Shared-ownership pointer to a list-based memory state.
void set_memory_map(const MemoryMap::Ptr &m)
A memory map can be used to provide default values for memory cells that are read before being writte...
static StatePtr instance(const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory)
Instantiates a new instance of memory state with specified register and memory states.
Describes (part of) a physical CPU register.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to partial symbolic operators. ...
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 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 BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for most instruction semantics RISC operators.
const MemoryMap::Ptr get_memory_map() const
A memory map can be used to provide default values for memory cells that are read before being writte...
virtual bool isBottom() const ROSE_OVERRIDE
Determines whether a value is a data-flow bottom.
static SValuePtr instance(size_t nbits, uint64_t name, uint64_t offset, bool negate)
Insantiate a new value with all the necessary parts.
boost::shared_ptr< class State > StatePtr
Shared-ownership pointer to partial symbolic semantics state.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.
virtual bool equal_registers(const StatePtr &other) const
Tests registers of two states for equality.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE
Create a new concrete semantic value.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators with specified state.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to partial symbolic semantics RISC operations.
virtual void hash(Combinatorics::Hasher &) const override
Hash this semantic value.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual bool must_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
static MemoryCellListPtr promote(const BaseSemantics::MemoryStatePtr &m)
Promote a base memory state pointer to a BaseSemantics::MemoryCellList pointer.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two unsigned values.
virtual void print_diff_registers(std::ostream &, const StatePtr &other_state, Formatter &) const
Print info about how registers differ.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified prototypical values.
Defines registers available for a particular architecture.
Definition: Registers.h:38
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
virtual const std::string & name() const
Property: Name used for debugging.
static StatePtr instance(const StatePtr &other)
Instantiates a new copy of an existing state.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a value to a stream using default format.
virtual void discard_popped_memory()
Removes from memory those values at addresses below the current stack pointer.
static SValuePtr instance(size_t nbits, uint64_t value)
Instantiate a new concrete value.
boost::shared_ptr< RegisterState > RegisterStatePtr
Shared-ownership pointer to a register state.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
static uint64_t nextName()
Returns the next available name.
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to a PartialSymbolicSemantics value.