Package it.unive.lisa
Class LiSAConfiguration
- java.lang.Object
-
- it.unive.lisa.LiSAConfiguration
-
public class LiSAConfiguration extends java.lang.ObjectA holder for the configuration of aLiSAanalysis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLiSAConfiguration.GraphTypeThe type of graphs that can be dumped by LiSA.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_WIDENING_THRESHOLDThe default number of fixpoint iteration on a given node after which calls toLattice.lub(Lattice)gets replaced withLattice.widening(Lattice).
-
Constructor Summary
Constructors Constructor Description LiSAConfiguration()Builds a new configuration object, with default settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LiSAConfigurationaddSemanticCheck(it.unive.lisa.checks.semantic.SemanticCheck<?,?,?,?> check)Adds the given semantic check to the ones that will be executed.LiSAConfigurationaddSemanticChecks(java.util.Collection<it.unive.lisa.checks.semantic.SemanticCheck<?,?,?,?>> checks)Adds the given semantic checks to the ones that will be executed.LiSAConfigurationaddSyntacticCheck(it.unive.lisa.checks.syntactic.SyntacticCheck check)Adds the given syntactic check to the ones that will be executed.LiSAConfigurationaddSyntacticChecks(java.util.Collection<it.unive.lisa.checks.syntactic.SyntacticCheck> checks)Adds the given syntactic checks to the ones that will be executed.booleanequals(java.lang.Object obj)it.unive.lisa.analysis.AbstractState<?,?,?,?>getAbstractState()Yields theAbstractStatefor the analysis.LiSAConfiguration.GraphTypegetAnalysisGraphs()Yields whether or not the results of analysis, if run, should be dumped in the form of graphs representing results on singleCFGs.it.unive.lisa.interprocedural.callgraph.CallGraphgetCallGraph()Yields theCallGraphfor the analysis.java.lang.Class<? extends it.unive.lisa.util.collections.workset.WorkingSet<it.unive.lisa.program.cfg.statement.Statement>>getFixpointWorkingSet()Yields the concrete class ofWorkingSetto be used in fixpoints.it.unive.lisa.interprocedural.InterproceduralAnalysis<?,?,?,?>getInterproceduralAnalysis()Yields theInterproceduralAnalysisfor the analysis.it.unive.lisa.interprocedural.OpenCallPolicygetOpenCallPolicy()Yields theOpenCallPolicyto use during the analysis.java.util.Collection<it.unive.lisa.checks.semantic.SemanticCheck<?,?,?,?>>getSemanticChecks()Yields the collection ofSemanticChecks that are to be executed during the analysis.java.util.Collection<it.unive.lisa.checks.syntactic.SyntacticCheck>getSyntacticChecks()Yields the collection ofSyntacticChecks that are to be executed during the analysis.intgetWideningThreshold()Yields the number of fixpoint iteration on a given node after which calls toLattice.lub(Lattice)gets replaced withLattice.widening(Lattice).java.lang.StringgetWorkdir()Yields the working directory where LiSA will dump all of its outputs.inthashCode()booleanisJsonOutput()Yields whether or not a json report file should be dumped at the end of the analysis.booleanisSerializeResults()Yields whether or not the results of the analyses should be dumped in the form of json graphs.LiSAConfigurationsetAbstractState(it.unive.lisa.analysis.AbstractState<?,?,?,?> state)Sets theAbstractStateto use for the analysis.LiSAConfigurationsetCallGraph(it.unive.lisa.interprocedural.callgraph.CallGraph callGraph)Sets theCallGraphto use for the analysis.LiSAConfigurationsetDumpAnalysis(LiSAConfiguration.GraphType analysisGraphs)Sets whether or not graph files, namedanalysis__<cfg name>.<format>, should be created and dumped in the working directory at the end of the analysis.LiSAConfigurationsetFixpointWorkingSet(java.lang.Class<? extends it.unive.lisa.util.collections.workset.WorkingSet<it.unive.lisa.program.cfg.statement.Statement>> fixpointWorkingSet)Sets the concrete class ofWorkingSetto be used in fixpoints.LiSAConfigurationsetInterproceduralAnalysis(it.unive.lisa.interprocedural.InterproceduralAnalysis<?,?,?,?> analysis)Sets theInterproceduralAnalysisto use for the analysis.LiSAConfigurationsetJsonOutput(boolean jsonOutput)Sets whether or not a json report file, namedreport.json, should be created and dumped in the working directory at the end of the analysis.LiSAConfigurationsetOpenCallPolicy(it.unive.lisa.interprocedural.OpenCallPolicy openCallPolicy)Sets theOpenCallPolicyto use during the analysis.LiSAConfigurationsetSerializeResults(boolean serializeResults)Sets whether or not the results of the analyses should be dumped in the form of json graphs.LiSAConfigurationsetWideningThreshold(int wideningThreshold)Sets the number of fixpoint iteration on a given node after which calls toLattice.lub(Lattice)gets replaced withLattice.widening(Lattice).LiSAConfigurationsetWorkdir(java.lang.String workdir)Sets the working directory for this instance of LiSA, that is, the directory files will be created, if any.java.lang.StringtoString()
-
-
-
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 toLattice.lub(Lattice)gets replaced withLattice.widening(Lattice).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LiSAConfiguration
public LiSAConfiguration()
Builds a new configuration object, with default settings. By default:- no syntactic check is executed
- no
AbstractStateis set for the analysis - no
CallGraphis set for the analysis - no
InterproceduralAnalysisis set for the analysis - the workdir is the one where LiSA was executed
- the results of the analysis will not be dumped
- the results of the analysis will not be serialized
- the json report will not be dumped
- the default warning threshold (5) will be used
- the open call policy used is
WorstCasePolicy
-
-
Method Detail
-
addSyntacticCheck
public LiSAConfiguration addSyntacticCheck(it.unive.lisa.checks.syntactic.SyntacticCheck check)
Adds the given syntactic check to the ones that will be executed. These checks will be immediately executed after LiSA is started.- Parameters:
check- the check to execute- Returns:
- the current (modified) configuration
-
addSyntacticChecks
public LiSAConfiguration addSyntacticChecks(java.util.Collection<it.unive.lisa.checks.syntactic.SyntacticCheck> checks)
Adds the given syntactic checks to the ones that will be executed. These checks will be immediately executed after LiSA is started.- Parameters:
checks- the checks to execute- Returns:
- the current (modified) configuration
-
addSemanticCheck
public LiSAConfiguration addSemanticCheck(it.unive.lisa.checks.semantic.SemanticCheck<?,?,?,?> check)
Adds the given semantic check to the ones that will be executed. These checks will be executed after the fixpoint iteration has been completed.- Parameters:
check- the check to execute- Returns:
- the current (modified) configuration
-
addSemanticChecks
public LiSAConfiguration addSemanticChecks(java.util.Collection<it.unive.lisa.checks.semantic.SemanticCheck<?,?,?,?>> checks)
Adds the given semantic checks to the ones that will be executed. These checks will be executed after the fixpoint iteration has been completed.- Parameters:
checks- the checks to execute- Returns:
- the current (modified) configuration
-
setCallGraph
public LiSAConfiguration setCallGraph(it.unive.lisa.interprocedural.callgraph.CallGraph callGraph)
Sets theCallGraphto use for the analysis. Any existing value is overwritten.- Parameters:
callGraph- the callgraph to use- Returns:
- the current (modified) configuration
-
setInterproceduralAnalysis
public LiSAConfiguration setInterproceduralAnalysis(it.unive.lisa.interprocedural.InterproceduralAnalysis<?,?,?,?> analysis)
Sets theInterproceduralAnalysisto use for the analysis. Any existing value is overwritten.- Parameters:
analysis- the interprocedural analysis to use- Returns:
- the current (modified) configuration
-
setAbstractState
public LiSAConfiguration setAbstractState(it.unive.lisa.analysis.AbstractState<?,?,?,?> state)
Sets theAbstractStateto use for the analysis. Any existing value is overwritten.- Parameters:
state- the abstract state to use- Returns:
- the current (modified) configuration
-
setDumpAnalysis
public LiSAConfiguration setDumpAnalysis(LiSAConfiguration.GraphType analysisGraphs)
Sets whether or not graph files, namedanalysis__<cfg name>.<format>, should be created and dumped in the working directory at the end of the analysis. These files will contain a graph representing each inputCFGs' structure, and whose nodes will contain a representation of the results of the semantic analysis on eachStatement.
To customize where the graphs should be generated, usesetWorkdir(String).- Parameters:
analysisGraphs- whether graphs will be generated containing the results of the analysis, and in what format- Returns:
- the current (modified) configuration
-
setJsonOutput
public LiSAConfiguration setJsonOutput(boolean jsonOutput)
Sets whether or not a json report file, namedreport.json, should be created and dumped in the working directory at the end of the analysis. This file will contain all theWarnings that have been generated, as well as a list of produced files.
To customize where the report should be generated, usesetWorkdir(String).- Parameters:
jsonOutput- iftrue, a json report will be generated after the analysis- Returns:
- the current (modified) configuration
-
setSerializeResults
public LiSAConfiguration setSerializeResults(boolean serializeResults)
Sets whether or not the results of the analyses should be dumped in the form of json graphs.- Parameters:
serializeResults- whether or not the graphs should be produced- Returns:
- the current (modified) configuration
-
setWorkdir
public LiSAConfiguration setWorkdir(java.lang.String workdir)
Sets the working directory for this instance of LiSA, that is, the directory files will be created, if any. If files need to be created and this method has not been invoked, LiSA will create them in the directory where it was executed from.- Parameters:
workdir- the path (relative or absolute) to the working directory- Returns:
- the current (modified) configuration
-
setFixpointWorkingSet
public LiSAConfiguration setFixpointWorkingSet(java.lang.Class<? extends it.unive.lisa.util.collections.workset.WorkingSet<it.unive.lisa.program.cfg.statement.Statement>> fixpointWorkingSet)
Sets the concrete class ofWorkingSetto be used in fixpoints.- Parameters:
fixpointWorkingSet- the class- Returns:
- the current (modified) configuration
-
setWideningThreshold
public LiSAConfiguration setWideningThreshold(int wideningThreshold)
Sets the number of fixpoint iteration on a given node after which calls toLattice.lub(Lattice)gets replaced withLattice.widening(Lattice).- Parameters:
wideningThreshold- the threshold- Returns:
- the current (modified) configuration
-
setOpenCallPolicy
public LiSAConfiguration setOpenCallPolicy(it.unive.lisa.interprocedural.OpenCallPolicy openCallPolicy)
Sets theOpenCallPolicyto use during the analysis.- Parameters:
openCallPolicy- the policy to use- Returns:
- the current (modified) configuration
-
getCallGraph
public it.unive.lisa.interprocedural.callgraph.CallGraph getCallGraph()
Yields theCallGraphfor the analysis. Might benullif none was set.- Returns:
- the call graph for the analysis
-
getInterproceduralAnalysis
public it.unive.lisa.interprocedural.InterproceduralAnalysis<?,?,?,?> getInterproceduralAnalysis()
Yields theInterproceduralAnalysisfor the analysis. Might benullif none was set.- Returns:
- the interprocedural analysis for the analysis
-
getAbstractState
public it.unive.lisa.analysis.AbstractState<?,?,?,?> getAbstractState()
Yields theAbstractStatefor the analysis. Might benullif none was set.- Returns:
- the abstract state for the analysis
-
getSyntacticChecks
public java.util.Collection<it.unive.lisa.checks.syntactic.SyntacticCheck> getSyntacticChecks()
Yields the collection ofSyntacticChecks that are to be executed during the analysis.- Returns:
- the syntactic checks
-
getSemanticChecks
public java.util.Collection<it.unive.lisa.checks.semantic.SemanticCheck<?,?,?,?>> getSemanticChecks()
Yields the collection ofSemanticChecks that are to be executed during the analysis.- Returns:
- the semantic checks
-
getAnalysisGraphs
public LiSAConfiguration.GraphType getAnalysisGraphs()
Yields whether or not the results of analysis, if run, should be dumped in the form of graphs representing results on singleCFGs.- Returns:
- whether or not the graphs should be dumped, and in what format
-
isJsonOutput
public boolean isJsonOutput()
Yields whether or not a json report file should be dumped at the end of the analysis.- Returns:
trueif the report should be produced
-
isSerializeResults
public boolean isSerializeResults()
Yields whether or not the results of the analyses should be dumped in the form of json graphs.- Returns:
trueif the graphs should be produced
-
getWorkdir
public java.lang.String getWorkdir()
Yields the working directory where LiSA will dump all of its outputs.- Returns:
- the working directory
-
getFixpointWorkingSet
public java.lang.Class<? extends it.unive.lisa.util.collections.workset.WorkingSet<it.unive.lisa.program.cfg.statement.Statement>> getFixpointWorkingSet()
Yields the concrete class ofWorkingSetto be used in fixpoints.- Returns:
- the working set class
-
getWideningThreshold
public int getWideningThreshold()
Yields the number of fixpoint iteration on a given node after which calls toLattice.lub(Lattice)gets replaced withLattice.widening(Lattice).- Returns:
- the widening threshold
-
getOpenCallPolicy
public it.unive.lisa.interprocedural.OpenCallPolicy getOpenCallPolicy()
Yields theOpenCallPolicyto use during the analysis.- Returns:
- the policy
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-