Class FixpointInfo

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static FixpointInfo BOTTOM
      The unique bottom instance of this class.
      java.util.Map<java.lang.String,​Lattice<?>> function
      The function containing the additional information.
    • Constructor Summary

      Constructors 
      Constructor Description
      FixpointInfo()
      Builds the function.
      FixpointInfo​(java.util.Map<java.lang.String,​Lattice<?>> mapping)
      Builds the function by using the given mapping.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FixpointInfo bottom()
      Yields the bottom element of this lattice.
      boolean equals​(java.lang.Object obj)  
      Lattice<?> get​(java.lang.String key)
      Yields the information associated to the given key.
      <T> T get​(java.lang.String key, java.lang.Class<T> type)
      Yields the information associated to the given key, casted to the given type.
      java.util.Set<java.lang.String> getKeys()
      Yields the set of keys currently in this mapping.
      java.util.Map<java.lang.String,​Lattice<?>> getMap()
      Yields the map associated with this mapping.
      java.util.Collection<Lattice<?>> getValues()
      Yields the values currently in this mapping.
      FixpointInfo glbAux​(FixpointInfo other)
      Performs the greatest lower bound operation between this lattice element and the given one, assuming that base cases have already been handled.
      int hashCode()  
      boolean isBottom()
      Yields true if and only if this object represents the bottom of the lattice.
      boolean isTop()
      Yields true if and only if this object represents the top of the lattice.
      java.util.Iterator<java.util.Map.Entry<java.lang.String,​Lattice<?>>> iterator()  
      boolean lessOrEqualAux​(FixpointInfo other)
      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.
      FixpointInfo lubAux​(FixpointInfo other)
      Performs the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled.
      FixpointInfo narrowingAux​(FixpointInfo other)
      Performs the narrowing operation between this lattice element and the given one, assuming that base cases have already been handled.
      FixpointInfo put​(java.lang.String key, Lattice<?> info)
      Yields a new instance of this class where the given information has been mapped to the given key.
      FixpointInfo putWeak​(java.lang.String key, Lattice<?> info)
      Yields a new instance of this class where the given information has been mapped to the given key.
      StructuredRepresentation representation()
      Yields a StructuredRepresentation of the information contained in this object's instance.
      FixpointInfo top()
      Yields the top element of this lattice.
      java.lang.String toString()  
      FixpointInfo wideningAux​(FixpointInfo other)
      Performs the widening operation between this lattice element and the given one, assuming that base cases have already been handled.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • BOTTOM

        public static final FixpointInfo BOTTOM
        The unique bottom instance of this class.
      • function

        public java.util.Map<java.lang.String,​Lattice<?>> function
        The function containing the additional information.
    • Constructor Detail

      • FixpointInfo

        public FixpointInfo()
        Builds the function.
      • FixpointInfo

        public FixpointInfo​(java.util.Map<java.lang.String,​Lattice<?>> mapping)
        Builds the function by using the given mapping.
        Parameters:
        mapping - the mapping to use
    • Method Detail

      • get

        public Lattice<?> get​(java.lang.String key)
        Yields the information associated to the given key.
        Parameters:
        key - the key
        Returns:
        the mapped information
      • get

        public <T> T get​(java.lang.String key,
                         java.lang.Class<T> type)
        Yields the information associated to the given key, casted to the given type.
        Type Parameters:
        T - the type to cast the return value of this method to
        Parameters:
        key - the key
        type - the type to cast the retrieved information to
        Returns:
        the mapped information
      • put

        public FixpointInfo put​(java.lang.String key,
                                Lattice<?> info)
        Yields a new instance of this class where the given information has been mapped to the given key. This is a strong update, meaning that the information previously mapped to the same key, if any, is lost. For a weak update, use putWeak(String, Lattice).
        Parameters:
        key - the key
        info - the information to store
        Returns:
        a new instance with the updated mapping
      • putWeak

        public FixpointInfo putWeak​(java.lang.String key,
                                    Lattice<?> info)
                             throws SemanticException
        Yields a new instance of this class where the given information has been mapped to the given key. This is a weak update, meaning that the information previously mapped to the same key, if any, is lubbed together with the given one, and the result is stored inside the mapping instead. For a strong update, use put(String, Lattice).
        Parameters:
        key - the key
        info - the information to store
        Returns:
        a new instance with the updated mapping
        Throws:
        SemanticException - if something goes wrong during the lub
      • lubAux

        public FixpointInfo lubAux​(FixpointInfo other)
                            throws SemanticException
        Description copied from interface: 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 interface BaseLattice<FixpointInfo>
        Parameters:
        other - the other lattice element
        Returns:
        the least upper bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • glbAux

        public FixpointInfo glbAux​(FixpointInfo other)
                            throws SemanticException
        Description copied from interface: BaseLattice
        Performs the greatest lower 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:
        glbAux in interface BaseLattice<FixpointInfo>
        Parameters:
        other - the other lattice element
        Returns:
        the greatest lower bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • wideningAux

        public FixpointInfo wideningAux​(FixpointInfo other)
                                 throws SemanticException
        Description copied from interface: BaseLattice
        Performs the widening 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))
        The default implementation of this method delegates to BaseLattice.lubAux(BaseLattice), and is thus safe for finite lattices and ACC ones.
        Specified by:
        wideningAux in interface BaseLattice<FixpointInfo>
        Parameters:
        other - the other lattice element
        Returns:
        the widening between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • narrowingAux

        public FixpointInfo narrowingAux​(FixpointInfo other)
                                  throws SemanticException
        Description copied from interface: BaseLattice
        Performs the narrowing 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))
        The default implementation of this method delegates to BaseLattice.glbAux(BaseLattice), and is thus safe for finite lattices and DCC ones.
        Specified by:
        narrowingAux in interface BaseLattice<FixpointInfo>
        Parameters:
        other - the other lattice element
        Returns:
        the narrowing between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • lessOrEqualAux

        public boolean lessOrEqualAux​(FixpointInfo other)
                               throws SemanticException
        Description copied from interface: 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 interface BaseLattice<FixpointInfo>
        Parameters:
        other - the other lattice element
        Returns:
        true if and only if that condition holds
        Throws:
        SemanticException - if an error occurs during the computation
      • top

        public FixpointInfo 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.
        Specified by:
        top in interface Lattice<FixpointInfo>
        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.
        Specified by:
        isTop in interface Lattice<FixpointInfo>
        Returns:
        true if this is the top of the lattice
      • bottom

        public FixpointInfo 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.
        Specified by:
        bottom in interface Lattice<FixpointInfo>
        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.
        Specified by:
        isBottom in interface Lattice<FixpointInfo>
        Returns:
        true if this is the bottom of the lattice
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface BaseLattice<FixpointInfo>
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface BaseLattice<FixpointInfo>
        Overrides:
        toString in class java.lang.Object
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.String,​Lattice<?>>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,​Lattice<?>>>
      • getKeys

        public java.util.Set<java.lang.String> getKeys()
        Yields the set of keys currently in this mapping.
        Returns:
        the set of keys
      • getValues

        public java.util.Collection<Lattice<?>> getValues()
        Yields the values currently in this mapping.
        Returns:
        the set of values
      • getMap

        public java.util.Map<java.lang.String,​Lattice<?>> getMap()
        Yields the map associated with this mapping.
        Returns:
        the associated map