Class CFAbstractAnalysis<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>>     
java.lang.Object
org.checkerframework.dataflow.analysis.AbstractAnalysis<V,S,T>
  
org.checkerframework.dataflow.analysis.ForwardAnalysisImpl<V,S,T>
  
org.checkerframework.framework.flow.CFAbstractAnalysis<V,S,T>  
- All Implemented Interfaces:
- Analysis<V,,- S, - T> - ForwardAnalysis<V,- S, - T> 
- Direct Known Subclasses:
- CFAnalysis,- KeyForAnalysis,- LockAnalysis,- NullnessAnalysis
public abstract class CFAbstractAnalysis<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>>     
extends ForwardAnalysisImpl<V,S,T>  
CFAbstractAnalysis is an extensible org.checkerframework.dataflow analysis for the
 Checker Framework that tracks the annotations using a flow-sensitive analysis. It uses an AnnotatedTypeFactory to provide checker-specific logic how to combine types (e.g., what is the
 type of a string concatenation, given the types of the two operands) and as an abstraction
 function (e.g., determine the annotations on literals).
 The purpose of this class is twofold: Firstly, it serves as factory for abstract values,
 stores and the transfer function. Furthermore, it makes it easy for the transfer function and the
 stores to access the AnnotatedTypeFactory, the qualifier hierarchy, etc.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA triple of field, value corresponding to the annotations on its declared type, value of its initializer.Nested classes/interfaces inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysisAbstractAnalysis.WorklistNested classes/interfaces inherited from interface org.checkerframework.dataflow.analysis.AnalysisAnalysis.BeforeOrAfter, Analysis.Direction
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final GenericAnnotatedTypeFactory<V,S, T, ? extends CFAbstractAnalysis<V, S, T>> A type factory that can provide static type annotations for AST Trees.protected final SourceCheckerA checker that contains command-line arguments and other information.protected final DependentTypesHelperThe dependent type helper used to standardize both annotations belonging to the type hierarchy, and contract expressions.protected final ProcessingEnvironmentThe associated processing environment.protected final List<CFAbstractAnalysis.FieldInitialValue<V>>Initial abstract types for fields.protected final QualifierHierarchyThe qualifier hierarchy for which to track annotations.protected final TypeHierarchyThe type hierarchy.protected final TypesInstance of the types utility.Fields inherited from class org.checkerframework.dataflow.analysis.ForwardAnalysisImplblockCount, elseStores, maxCountBeforeWidening, storesAtReturnStatements, thenStoresFields inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysiscfg, currentInput, currentNode, currentTree, direction, finalLocalValues, inputs, isRunning, nodeValues, transferFunction, worklist
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCFAbstractAnalysis(BaseTypeChecker checker, GenericAnnotatedTypeFactory<V, S, T, ? extends CFAbstractAnalysis<V, S, T>> factory) Create a CFAbstractAnalysis.protectedCFAbstractAnalysis(BaseTypeChecker checker, GenericAnnotatedTypeFactory<V, S, T, ? extends CFAbstractAnalysis<V, S, T>> factory, int maxCountBeforeWidening) Create a CFAbstractAnalysis.
- 
Method SummaryModifier and TypeMethodDescriptionCreates an abstract value from the annotated type mirror.createAbstractValue(AnnotationMirrorSet annotations, TypeMirror underlyingType) Returns an abstract value containing the givenannotationsandunderlyingType.abstract SReturns an identical copy of the stores.abstract ScreateEmptyStore(boolean sequentialSemantics) Returns an empty store of the appropriate type.createSingleAnnotationValue(AnnotationMirror anno, TypeMirror underlyingType) Returns an abstract value containing an annotated type with the annotationanno, and 'top' for all other hierarchies.Returns the transfer function to be used by the analysis.defaultCreateAbstractValue(CFAbstractAnalysis<CFValue, ?, ?> analysis, AnnotationMirrorSet annotations, TypeMirror underlyingType) Default implementation forcreateAbstractValue(AnnotationMirrorSet, TypeMirror).getEnv()Get the processing environment.A list of initial abstract values for the fields.GenericAnnotatedTypeFactory<V,S, T, ? extends CFAbstractAnalysis<V, S, T>> getTypes()Get the types utility.voidperformAnalysis(ControlFlowGraph cfg, List<CFAbstractAnalysis.FieldInitialValue<V>> fieldValues) Analyze the given control flow graph.Methods inherited from class org.checkerframework.dataflow.analysis.ForwardAnalysisImpladdStoreBefore, callTransferFunction, getInput, getInputBefore, getReturnStatementStores, getStoreBefore, initFields, initInitialInputs, performAnalysis, performAnalysisBlock, propagateStoresTo, runAnalysisForMethods inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysisaddToWorklist, getContainingClass, getContainingMethod, getCurrentTree, getDirection, getExceptionalExitStore, getNodesForTree, getNodeValues, getRegularExitStore, getResult, getTransferFunction, getValue, getValue, init, isIgnoredExceptionType, isRunning, readFromStore, setCurrentNode, setCurrentTree, updateNodeValuesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.dataflow.analysis.AnalysisgetDirection, getExceptionalExitStore, getRegularExitStore, getResult, getTransferFunction, getValue, getValue, isRunning
- 
Field Details- 
qualifierHierarchyThe qualifier hierarchy for which to track annotations.
- 
typeHierarchyThe type hierarchy.
- 
dependentTypesHelperThe dependent type helper used to standardize both annotations belonging to the type hierarchy, and contract expressions.
- 
atypeFactoryprotected final GenericAnnotatedTypeFactory<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, atypeFactoryS>, T extends CFAbstractTransfer<V, S, T>, ? extends CFAbstractAnalysis<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>, T extends CFAbstractTransfer<V, S, T>>> A type factory that can provide static type annotations for AST Trees.
- 
checkerA checker that contains command-line arguments and other information.
- 
fieldValuesprotected final List<CFAbstractAnalysis.FieldInitialValue<V extends CFAbstractValue<V>>> fieldValuesInitial abstract types for fields.
- 
envThe associated processing environment.
- 
typesInstance of the types utility.
 
- 
- 
Constructor Details- 
CFAbstractAnalysisprotected CFAbstractAnalysis(BaseTypeChecker checker, GenericAnnotatedTypeFactory<V, S, T, ? extends CFAbstractAnalysis<V, S, T>> factory, int maxCountBeforeWidening) Create a CFAbstractAnalysis.- Parameters:
- checker- a checker that contains command-line arguments and other information
- factory- an annotated type factory to introduce type and dataflow rules
- maxCountBeforeWidening- number of times a block can be analyzed before widening
 
- 
CFAbstractAnalysisprotected CFAbstractAnalysis(BaseTypeChecker checker, GenericAnnotatedTypeFactory<V, S, T, ? extends CFAbstractAnalysis<V, S, T>> factory) Create a CFAbstractAnalysis.- Parameters:
- checker- a checker that contains command-line arguments and other information
- factory- an annotated type factory to introduce type and dataflow rules
 
 
- 
- 
Method Details- 
performAnalysispublic void performAnalysis(ControlFlowGraph cfg, List<CFAbstractAnalysis.FieldInitialValue<V>> fieldValues) Analyze the given control flow graph.- Parameters:
- cfg- control flow graph to analyze
- fieldValues- initial values of the fields
 
- 
getFieldInitialValuesA list of initial abstract values for the fields.- Returns:
- a list of initial abstract values for the fields
 
- 
createTransferFunctionReturns the transfer function to be used by the analysis.- Returns:
- the transfer function to be used by the analysis
 
- 
createEmptyStoreReturns an empty store of the appropriate type.- Returns:
- an empty store of the appropriate type
 
- 
createCopiedStoreReturns an identical copy of the stores.- Returns:
- an identical copy of the store s
 
- 
createAbstractValueCreates an abstract value from the annotated type mirror. The value contains the set of primary annotations on the type, unless the type is an AnnotatedWildcardType. For an AnnotatedWildcardType, the annotations in the created value are the primary annotations on the extends bound. SeeCFAbstractValuefor an explanation.- Parameters:
- type- the type to convert into an abstract value
- Returns:
- an abstract value containing the given annotated type
 
- 
createAbstractValuepublic abstract @Nullable V createAbstractValue(AnnotationMirrorSet annotations, TypeMirror underlyingType) Returns an abstract value containing the givenannotationsandunderlyingType. Returns null if the annotation set has missing annotations.- Parameters:
- annotations- the annotations for the result annotated type
- underlyingType- the unannotated type for the result annotated type
- Returns:
- an abstract value containing the given annotationsandunderlyingType
 
- 
defaultCreateAbstractValuepublic CFValue defaultCreateAbstractValue(CFAbstractAnalysis<CFValue, ?, ?> analysis, AnnotationMirrorSet annotations, TypeMirror underlyingType) Default implementation forcreateAbstractValue(AnnotationMirrorSet, TypeMirror).
- 
getTypeHierarchy
- 
getTypeFactory
- 
createSingleAnnotationValueReturns an abstract value containing an annotated type with the annotationanno, and 'top' for all other hierarchies. The underlying type isunderlyingType.- Parameters:
- anno- the annotation for the result annotated type
- underlyingType- the unannotated type for the result annotated type
- Returns:
- an abstract value with annoandunderlyingType
 
- 
getTypesGet the types utility.- Returns:
- types
 
- 
getEnvGet the processing environment.- Returns:
- env
 
 
-