Interface MemConversion

All Superinterfaces:
Conversion

public interface MemConversion extends Conversion

A MemConversion converts an expression of pointer or set-of pointer type to $mem type.

Given an expression e that will be converted to have $mem type, the following restrictions will be applied to e:

  • If e has the form: &(*p), apply the rest of the restrictions on p; Or if e has the form: &(p[e']) and p has (set-of) pointer type, apply the rest of the restrictions on p.
  • e and any sub-expressions of e must not be any of these form: *p, p[e'], p->id where p has the type of a set-of pointers
  • If e and any sub-expressions of e has type of a set-of pointers, it can only have such a form e' + I, where e' is a sub-expression of and I is an expression of (set-of) integer type

The restrictions above is used to prevent cases like int * p[N]; $mem m = p[0 .. n]. It is hard, if not impossible to represent the value of m if n, N have non-concrete values.

See SetType, MemType for more informations

  • Nested Class Summary

    Nested classes/interfaces inherited from interface edu.udel.cis.vsl.abc.ast.conversion.IF.Conversion

    Conversion.ConversionKind
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the type of the entity after applying this conversion.

    Methods inherited from interface edu.udel.cis.vsl.abc.ast.conversion.IF.Conversion

    conversionKind, getOldType
  • Method Details

    • getNewType

      MemType getNewType()
      Description copied from interface: Conversion
      Returns the type of the entity after applying this conversion.
      Specified by:
      getNewType in interface Conversion
      Returns:
      the post-conversion type