Package it.unive.lisa

Class LiSAConfiguration


  • public class LiSAConfiguration
    extends java.lang.Object
    A holder for the configuration of a LiSA analysis.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LiSAConfiguration.GraphType
      The type of graphs that can be dumped by LiSA.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      it.unive.lisa.analysis.AbstractState<?,​?,​?,​?> abstractState
      The AbstractState instance to run during the analysis.
      LiSAConfiguration.GraphType analysisGraphs
      Sets the format to use for dumping graph files, named <cfg signature>[optional numeric hash].<format>, in the working directory at the end of the analysis.
      it.unive.lisa.interprocedural.callgraph.CallGraph callGraph
      The CallGraph instance to use during the analysis.
      static int DEFAULT_WIDENING_THRESHOLD
      The default number of fixpoint iteration on a given node after which calls to Lattice.lub(Lattice) gets replaced with Lattice.widening(Lattice).
      java.lang.Class<?> fixpointWorkingSet
      The concrete class of WorkingSet to be used in fixpoints.
      it.unive.lisa.interprocedural.InterproceduralAnalysis<?,​?,​?,​?> interproceduralAnalysis
      The InterproceduralAnalysis instance to use during the analysis.
      boolean jsonOutput
      Sets whether or not a json report file, named report.json, should be created and dumped in the working directory at the end of the analysis.
      it.unive.lisa.interprocedural.OpenCallPolicy openCallPolicy
      The OpenCallPolicy to be used for computing the result of OpenCalls.
      java.util.Collection<it.unive.lisa.checks.semantic.SemanticCheck<?,​?,​?,​?>> semanticChecks
      The collection of SemanticChecks to execute.
      boolean serializeInputs
      Whether or not the inputs CFGs to the analysis should be dumped in json format before the analysis starts.
      boolean serializeResults
      Whether or not the results of the analysis (if executed) should be dumped in json format.
      java.util.Collection<it.unive.lisa.checks.syntactic.SyntacticCheck> syntacticChecks
      The collection of SyntacticChecks to execute.
      int wideningThreshold
      The number of fixpoint iteration on a given node after which calls to Lattice.lub(Lattice) gets replaced with Lattice.widening(Lattice).
      java.lang.String workdir
      The working directory for this instance of LiSA, that is, the directory files will be created, if any (log files excluded, use the logging configuration for controlling where those are placed).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_WIDENING_THRESHOLD

        public static final int DEFAULT_WIDENING_THRESHOLD
        The default number of fixpoint iteration on a given node after which calls to Lattice.lub(Lattice) gets replaced with Lattice.widening(Lattice).
        See Also:
        Constant Field Values
      • syntacticChecks

        public final java.util.Collection<it.unive.lisa.checks.syntactic.SyntacticCheck> syntacticChecks
        The collection of SyntacticChecks to execute. These checks will be immediately executed after LiSA is started, as they do not require any semantic information. Defaults to an empty set.
      • semanticChecks

        public final java.util.Collection<it.unive.lisa.checks.semantic.SemanticCheck<?,​?,​?,​?>> semanticChecks
        The collection of SemanticChecks to execute. These will be executed after the fixpoint iteration has been completed, and will be provided with the computed fixpoint results (customizable through abstractState) and the CallGraph (that can be customized through callGraph) that has been built. Defaults to an empty set.
      • callGraph

        public it.unive.lisa.interprocedural.callgraph.CallGraph callGraph
        The CallGraph instance to use during the analysis. Defaults to null. Setting this field is optional: if an analysis is to be executed (that is, if abstractState has been set), a default CallGraph instance will be created through LiSAFactory.getDefaultFor(Class, Object...) in order to perform the analysis.
      • interproceduralAnalysis

        public it.unive.lisa.interprocedural.InterproceduralAnalysis<?,​?,​?,​?> interproceduralAnalysis
        The InterproceduralAnalysis instance to use during the analysis. Defaults to null. Setting this field is optional: if an analysis is to be executed (that is, if abstractState has been set), a default InterproceduralAnalysis instance will be created through LiSAFactory.getDefaultFor(Class, Object...) in order to perform the analysis.
      • abstractState

        public it.unive.lisa.analysis.AbstractState<?,​?,​?,​?> abstractState
        The AbstractState instance to run during the analysis. This will be used as singleton to retrieve the top instances needed to boot up the analysis, and can thus be any lattice element. If no value is set for this field, no analysis will be executed. Defaults to null.
      • analysisGraphs

        public LiSAConfiguration.GraphType analysisGraphs
        Sets the format to use for dumping graph files, named <cfg signature>[optional numeric hash].<format>, in the working directory at the end of the analysis. These files will contain a graph representing each input CFGs' structure, and whose nodes will contain a representation of the results of the semantic analysis on each Statement. To customize where the graphs should be generated, use workdir. Defaults to LiSAConfiguration.GraphType.NONE (that is, no graphs will be dumped).
      • serializeInputs

        public boolean serializeInputs
        Whether or not the inputs CFGs to the analysis should be dumped in json format before the analysis starts. Graph files are named <cfg signature>_cfg.json, and are dumped in the path pointed to by workdir. If analysisGraphs is not set to LiSAConfiguration.GraphType.NONE, inputs will also be dumped using the format specified by that field. Defaults to false.
      • serializeResults

        public boolean serializeResults
        Whether or not the results of the analysis (if executed) should be dumped in json format. Graph files are named <cfg signature>[optional numeric hash]json, and are dumped in the path pointed to by workdir. If analysisGraphs is not set to LiSAConfiguration.GraphType.NONE, results will also be dumped using the format specified by that field. Defaults to false.
      • jsonOutput

        public boolean jsonOutput
        Sets whether or not a json report file, named report.json, should be created and dumped in the working directory at the end of the analysis. This file will contain all the Warnings that have been generated, as well as a list of produced files. To customize where the report should be generated, use workdir. Defaults to false.
      • workdir

        public java.lang.String workdir
        The working directory for this instance of LiSA, that is, the directory files will be created, if any (log files excluded, use the logging configuration for controlling where those are placed). The value of this field is passed to the FileManager instance of the analysis. Defaults to the directory where LiSA was run from.
      • wideningThreshold

        public int wideningThreshold
        The number of fixpoint iteration on a given node after which calls to Lattice.lub(Lattice) gets replaced with Lattice.widening(Lattice). Defaults to DEFAULT_WIDENING_THRESHOLD.
      • fixpointWorkingSet

        public java.lang.Class<?> fixpointWorkingSet
        The concrete class of WorkingSet to be used in fixpoints. Defaults to FIFOWorkingSet.
      • openCallPolicy

        public it.unive.lisa.interprocedural.OpenCallPolicy openCallPolicy
        The OpenCallPolicy to be used for computing the result of OpenCalls. Defaults to WorstCasePolicy.
    • Constructor Detail

      • LiSAConfiguration

        public LiSAConfiguration()
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object