Class Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>

  • Type Parameters:
    V - the kind of auxiliary domain
    All Implemented Interfaces:
    it.unive.lisa.analysis.BaseLattice<Stability<V>>, it.unive.lisa.analysis.Lattice<Stability<V>>, it.unive.lisa.analysis.ScopedObject<Stability<V>>, it.unive.lisa.analysis.SemanticDomain<Stability<V>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>, it.unive.lisa.analysis.value.ValueDomain<Stability<V>>, it.unive.lisa.analysis.value.ValueOracle, it.unive.lisa.util.representation.StructuredObject

    public class Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
    extends java.lang.Object
    implements it.unive.lisa.analysis.BaseLattice<Stability<V>>, it.unive.lisa.analysis.value.ValueDomain<Stability<V>>
    Implementation of the stability abstract domain (yet to appear publicly). This domain computes per-variable numerical trends to infer stability, covariance and contravariance relations on program variables, exploiting an auxiliary domain of choice. This is implemented as an open product where the stability domain gathers information from the auxiliary one through boolean queries.

    Implementation-wise, this class is built as a product between a given ValueDomain aux and a ValueEnvironment trends of Trend instances, representing per-variable trends. Queries are carried over by the SemanticDomain.satisfies(SymbolicExpression, ProgramPoint, SemanticOracle) operator invoked on aux.
    • Field Summary

      • Fields inherited from interface it.unive.lisa.analysis.Lattice

        BOTTOM_STRING, TOP_STRING
    • Constructor Summary

      Constructors 
      Constructor Description
      Stability​(V aux)
      Builds the top stability domain, using aux as auxiliary domain.
      Stability​(V aux, it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend> trends)
      Builds a stability domain instance, using aux as auxiliary domain.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Stability<V> assign​(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Stability<V> assume​(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle)  
      Stability<V> bottom()  
      Stability<V> combine​(Stability<V> other)
      Yields the combination of the trends in this stability instance with the ones contained in the given one.
      boolean equals​(java.lang.Object obj)  
      Stability<V> forgetIdentifier​(it.unive.lisa.symbolic.value.Identifier id)  
      Stability<V> forgetIdentifiersIf​(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)  
      V getAuxiliaryDomain()
      Yields the auxiliary domain contained in this domain instance.
      java.util.Map<Trend,​java.util.Set<it.unive.lisa.symbolic.value.Identifier>> getCovarianceClasses()
      Yields a mapping from Trends to the Identifiers having that trend.
      it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend> getTrends()
      Yields the per-variable trends contained in this domain instance.
      Stability<V> glbAux​(Stability<V> other)  
      int hashCode()  
      boolean isBottom()  
      boolean isTop()  
      boolean knowsIdentifier​(it.unive.lisa.symbolic.value.Identifier id)  
      boolean lessOrEqualAux​(Stability<V> other)  
      Stability<V> lubAux​(Stability<V> other)  
      Stability<V> popScope​(it.unive.lisa.analysis.ScopeToken token)  
      Stability<V> pushScope​(it.unive.lisa.analysis.ScopeToken token)  
      it.unive.lisa.util.representation.StructuredRepresentation representation()  
      it.unive.lisa.analysis.lattices.Satisfiability satisfies​(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Stability<V> smallStepSemantics​(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Stability<V> top()  
      java.lang.String toString()  
      Stability<V> wideningAux​(Stability<V> other)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface it.unive.lisa.analysis.BaseLattice

        glb, lessOrEqual, lub, narrowing, narrowingAux, widening
      • Methods inherited from interface it.unive.lisa.analysis.SemanticDomain

        forgetIdentifiers, getAllDomainInstances, getDomainInstance
      • Methods inherited from interface it.unive.lisa.analysis.value.ValueDomain

        applyReplacement
    • Constructor Detail

      • Stability

        public Stability​(V aux)
        Builds the top stability domain, using aux as auxiliary domain.
        Parameters:
        aux - the auxiliary domain
      • Stability

        public Stability​(V aux,
                         it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend> trends)
        Builds a stability domain instance, using aux as auxiliary domain.
        Parameters:
        aux - the auxiliary domain
        trends - the existing per-variable trend information
    • Method Detail

      • lubAux

        public Stability<V> lubAux​(Stability<V> other)
                            throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lubAux in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • glbAux

        public Stability<V> glbAux​(Stability<V> other)
                            throws it.unive.lisa.analysis.SemanticException
        Specified by:
        glbAux in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • wideningAux

        public Stability<V> wideningAux​(Stability<V> other)
                                 throws it.unive.lisa.analysis.SemanticException
        Specified by:
        wideningAux in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • lessOrEqualAux

        public boolean lessOrEqualAux​(Stability<V> other)
                               throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lessOrEqualAux in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • isTop

        public boolean isTop()
        Specified by:
        isTop in interface it.unive.lisa.analysis.Lattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
      • isBottom

        public boolean isBottom()
        Specified by:
        isBottom in interface it.unive.lisa.analysis.Lattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
      • top

        public Stability<V> top()
        Specified by:
        top in interface it.unive.lisa.analysis.Lattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
      • bottom

        public Stability<V> bottom()
        Specified by:
        bottom in interface it.unive.lisa.analysis.Lattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
      • pushScope

        public Stability<V> pushScope​(it.unive.lisa.analysis.ScopeToken token)
                               throws it.unive.lisa.analysis.SemanticException
        Specified by:
        pushScope in interface it.unive.lisa.analysis.ScopedObject<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • popScope

        public Stability<V> popScope​(it.unive.lisa.analysis.ScopeToken token)
                              throws it.unive.lisa.analysis.SemanticException
        Specified by:
        popScope in interface it.unive.lisa.analysis.ScopedObject<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • assign

        public Stability<V> assign​(it.unive.lisa.symbolic.value.Identifier id,
                                   it.unive.lisa.symbolic.value.ValueExpression expression,
                                   it.unive.lisa.program.cfg.ProgramPoint pp,
                                   it.unive.lisa.analysis.SemanticOracle oracle)
                            throws it.unive.lisa.analysis.SemanticException
        Specified by:
        assign in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • smallStepSemantics

        public Stability<V> smallStepSemantics​(it.unive.lisa.symbolic.value.ValueExpression expression,
                                               it.unive.lisa.program.cfg.ProgramPoint pp,
                                               it.unive.lisa.analysis.SemanticOracle oracle)
                                        throws it.unive.lisa.analysis.SemanticException
        Specified by:
        smallStepSemantics in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • assume

        public Stability<V> assume​(it.unive.lisa.symbolic.value.ValueExpression expression,
                                   it.unive.lisa.program.cfg.ProgramPoint src,
                                   it.unive.lisa.program.cfg.ProgramPoint dest,
                                   it.unive.lisa.analysis.SemanticOracle oracle)
                            throws it.unive.lisa.analysis.SemanticException
        Specified by:
        assume in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • knowsIdentifier

        public boolean knowsIdentifier​(it.unive.lisa.symbolic.value.Identifier id)
        Specified by:
        knowsIdentifier in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
      • forgetIdentifier

        public Stability<V> forgetIdentifier​(it.unive.lisa.symbolic.value.Identifier id)
                                      throws it.unive.lisa.analysis.SemanticException
        Specified by:
        forgetIdentifier in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • forgetIdentifiersIf

        public Stability<V> forgetIdentifiersIf​(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)
                                         throws it.unive.lisa.analysis.SemanticException
        Specified by:
        forgetIdentifiersIf in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • satisfies

        public it.unive.lisa.analysis.lattices.Satisfiability satisfies​(it.unive.lisa.symbolic.value.ValueExpression expression,
                                                                        it.unive.lisa.program.cfg.ProgramPoint pp,
                                                                        it.unive.lisa.analysis.SemanticOracle oracle)
                                                                 throws it.unive.lisa.analysis.SemanticException
        Specified by:
        satisfies in interface it.unive.lisa.analysis.SemanticDomain<Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.symbolic.value.Identifier>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • representation

        public it.unive.lisa.util.representation.StructuredRepresentation representation()
        Specified by:
        representation in interface it.unive.lisa.util.representation.StructuredObject
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface it.unive.lisa.analysis.BaseLattice<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
        Overrides:
        toString in class java.lang.Object
      • getTrends

        public it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend> getTrends()
        Yields the per-variable trends contained in this domain instance.
        Returns:
        the trends
      • getAuxiliaryDomain

        public V getAuxiliaryDomain()
        Yields the auxiliary domain contained in this domain instance.
        Returns:
        the auxiliary domain
      • combine

        public Stability<V> combine​(Stability<V> other)
                             throws it.unive.lisa.analysis.SemanticException
        Yields the combination of the trends in this stability instance with the ones contained in the given one. This operation is to be interpreted as the sequential concatenation of the two: if two (blocks of) instructions are executed sequentially, a variable having t1 trend in the former and t2 trend in the latter would have t1.combine(t2) as an overall trend. This delegates to Trend.combine(Trend) for single-trend combination.
        Parameters:
        other - the other trends
        Returns:
        the combination of the two trends
        Throws:
        it.unive.lisa.analysis.SemanticException - if something goes wrong during the computation
      • getCovarianceClasses

        public java.util.Map<Trend,​java.util.Set<it.unive.lisa.symbolic.value.Identifier>> getCovarianceClasses()
        Yields a mapping from Trends to the Identifiers having that trend.
        Returns:
        the mapping