Class ExpressionStore<V extends Lattice<V>>

  • Type Parameters:
    V - the type of lattice mapped from this store
    All Implemented Interfaces:
    Lattice<ExpressionStore<V>>, java.lang.Iterable<java.util.Map.Entry<Expression,​V>>

    public class ExpressionStore<V extends Lattice<V>>
    extends FunctionalLattice<ExpressionStore<V>,​Expression,​V>
    A functional lattice that stores instances of Lattice computed on intermediate expressions inside root statements. Storing states in such an object enables easy fixpoint computation thanks to the function lub and widening operations
    • Constructor Detail

      • ExpressionStore

        public ExpressionStore​(V lattice)
        Builds the store.
        Parameters:
        lattice - an instance of the concrete lattice that will be mapped in this store
    • Method Detail

      • put

        public V put​(Expression expression,
                     V state)
        Stores the given lattice element for the given expression. This is a "forced" update, without performing any lattice operation if a mapping for the given expression already exists.
        Parameters:
        expression - the expression whose state needs to be set
        state - the state to set
        Returns:
        the previous state mapped to expression, or null
      • top

        public ExpressionStore<V> top()
        Description copied from interface: Lattice
        Yields the top element of this lattice. The returned element should be unique across different calls to this method, since Lattice.isTop() uses reference equality by default. If the value returned by this method is not a singleton, override Lattice.isTop() accordingly to provide a coherent test.
        Returns:
        the top element
      • isTop

        public boolean isTop()
        Description copied from interface: Lattice
        Yields true if and only if this object represents the top of the lattice. The default implementation of this method uses reference equality between this and the value returned by Lattice.top(), thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.
        Returns:
        true if this is the top of the lattice
      • bottom

        public ExpressionStore<V> bottom()
        Description copied from interface: Lattice
        Yields the bottom element of this lattice. The returned element should be unique across different calls to this method, since Lattice.isBottom() uses reference equality by default. If the value returned by this method is not a singleton, override Lattice.isBottom() accordingly to provide a coherent test.
        Returns:
        the bottom element
      • isBottom

        public boolean isBottom()
        Description copied from interface: Lattice
        Yields true if and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality between this and the value returned by Lattice.bottom(), thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.
        Returns:
        true if this is the bottom of the lattice