Class InferredValue.InferredPair<T extends InferredValue<T>>

    • Constructor Detail

      • InferredPair

        public InferredPair​(T domain,
                            T inferred,
                            T state)
        Builds the pair.
        Parameters:
        domain - a singleton instance to be used during semantic operations to retrieve top and bottom values
        inferred - the inferred value
        state - the execution state
    • Method Detail

      • getInferred

        public T getInferred()
        Yields the instance of InferredValue representing the inferred value.
        Returns:
        the inferred value
      • getState

        public T getState()
        Yields the instance of InferredValue representing the execution state.
        Returns:
        the execution state
      • top

        public InferredValue.InferredPair<T> 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 InferredValue.InferredPair<T> 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
      • lubAux

        protected InferredValue.InferredPair<T> lubAux​(InferredValue.InferredPair<T> other)
                                                throws SemanticException
        Description copied from class: BaseLattice
        Performs the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        lubAux in class BaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>
        Parameters:
        other - the other lattice element
        Returns:
        the least upper bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • lessOrEqualAux

        protected boolean lessOrEqualAux​(InferredValue.InferredPair<T> other)
                                  throws SemanticException
        Description copied from class: BaseLattice
        Yields true if and only if this lattice element is in relation with (usually represented through ≤) the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        lessOrEqualAux in class BaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>
        Parameters:
        other - the other lattice element
        Returns:
        true if and only if that condition holds
        Throws:
        SemanticException - if an error occurs during the computation