Class ExpressionSet<T extends SymbolicExpression>

    • Constructor Detail

      • ExpressionSet

        public ExpressionSet()
        Builds the empty set lattice element.
      • ExpressionSet

        public ExpressionSet​(T exp)
        Builds a singleton set lattice element.
        Parameters:
        exp - the expression
      • ExpressionSet

        public ExpressionSet​(java.util.Set<T> set)
        Builds a set lattice element.
        Parameters:
        set - the set of expression
    • Method Detail

      • top

        public ExpressionSet<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
      • bottom

        public ExpressionSet<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
      • mk

        public ExpressionSet<T> mk​(java.util.Set<T> set)
        Description copied from class: SetLattice
        Utility for creating a concrete instance of SetLattice given a set. This decouples the instance of set used during computation of the elements to put in the lattice from the actual type of set underlying the lattice.
        Specified by:
        mk in class SetLattice<ExpressionSet<T extends SymbolicExpression>,​T extends SymbolicExpression>
        Parameters:
        set - the set containing the elements that must be included in the lattice instance
        Returns:
        a new concrete instance of SetLattice containing the elements of the given set
      • lubAux

        public ExpressionSet<T> lubAux​(ExpressionSet<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))
        Overrides:
        lubAux in class SetLattice<ExpressionSet<T extends SymbolicExpression>,​T extends SymbolicExpression>
        Parameters:
        other - the other lattice element
        Returns:
        the least upper bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • pushScope

        public ExpressionSet<SymbolicExpression> pushScope​(ScopeToken token)
                                                    throws SemanticException
        Pushes a new scope, identified by the give token, in the set. This recursively invokes SymbolicExpression.pushScope(ScopeToken) on all elements of the set (return type is forced to ExpressionSet<SymbolicExpression> since this operation returns the root of the hierarchy).
        Parameters:
        token - the token identifying the scope to push
        Returns:
        a copy of this set where the expressions have the given scope pushed
        Throws:
        SemanticException - if an error occurs during the computation
      • popScope

        public ExpressionSet<SymbolicExpression> popScope​(ScopeToken token)
                                                   throws SemanticException
        Pops the scope identified by the given token from the set. This recursively invokes SymbolicExpression.popScope(ScopeToken) on all elements of the set (return type is forced to ExpressionSet<SymbolicExpression> since this operation returns the root of the hierarchy).
        Parameters:
        token - the token of the scope to be restored
        Returns:
        a copy of this domain where the the expressions have the given scope popped
        Throws:
        SemanticException - if an error occurs during the computation