public abstract class CFAbstractAnalysis<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>> extends Analysis<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.
Analysis.Worklist| Modifier and Type | Field and Description |
|---|---|
protected GenericAnnotatedTypeFactory<V,S,T,? extends CFAbstractAnalysis<V,S,T>> |
atypeFactory
A type factory that can provide static type annotations for AST Trees.
|
protected SourceChecker |
checker
A checker used to do error reporting.
|
protected List<Pair<VariableElement,V>> |
fieldValues
Initial abstract types for fields.
|
protected QualifierHierarchy |
qualifierHierarchy
The qualifier hierarchy for which to track annotations.
|
protected TypeHierarchy |
typeHierarchy
The type hierarchy.
|
cfg, currentInput, currentNode, currentTree, elseStores, env, finalLocalValues, inputs, isRunning, nodeValues, storesAtReturnStatements, thenStores, transferFunction, types, worklist| Constructor and Description |
|---|
CFAbstractAnalysis(BaseTypeChecker checker,
GenericAnnotatedTypeFactory<V,S,T,? extends CFAbstractAnalysis<V,S,T>> factory,
List<Pair<VariableElement,V>> fieldValues) |
| Modifier and Type | Method and Description |
|---|---|
abstract V |
createAbstractValue(AnnotatedTypeMirror type) |
abstract S |
createCopiedStore(S s) |
abstract S |
createEmptyStore(boolean sequentialSemantics) |
V |
createSingleAnnotationValue(AnnotationMirror anno,
TypeMirror underlyingType)
Returns an abstract value containing an annotated type with the
annotation
anno, and 'top' for all other hierarchies. |
T |
createTransferFunction() |
CFValue |
defaultCreateAbstractValue(CFAbstractAnalysis<CFValue,?,?> analysis,
AnnotatedTypeMirror type)
Default implementation for
createAbstractValue(AnnotatedTypeMirror) that takes care of
invalid types. |
List<Pair<VariableElement,V>> |
getFieldValues() |
GenericAnnotatedTypeFactory<V,S,T,? extends CFAbstractAnalysis<V,S,T>> |
getTypeFactory() |
<W extends GenericAnnotatedTypeFactory<?,?,?,?>,U extends BaseTypeChecker> |
getTypeFactoryOfSubchecker(Class<U> checkerClass) |
TypeHierarchy |
getTypeHierarchy() |
void |
outputToDotFile(String outputFile,
boolean verbose)
Print a DOT graph of the CFG and analysis info for inspection.
|
addStoreBefore, addToWorklist, callTransferFunction, getContainingClass, getContainingMethod, getCurrentTree, getEnv, getExceptionalExitStore, getInput, getInputBefore, getNodeForTree, getRegularExitStore, getResult, getReturnStatementStores, getStoreBefore, getTransferFunction, getTypes, getValue, getValue, init, isRunning, performAnalysis, propagateStoresTo, readFromStore, setCurrentTree, setTransferFunction, updateNodeValuesprotected final QualifierHierarchy qualifierHierarchy
protected final TypeHierarchy typeHierarchy
protected final GenericAnnotatedTypeFactory<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>,? extends CFAbstractAnalysis<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>>> atypeFactory
protected final SourceChecker checker
protected final List<Pair<VariableElement,V extends CFAbstractValue<V>>> fieldValues
public CFAbstractAnalysis(BaseTypeChecker checker, GenericAnnotatedTypeFactory<V,S,T,? extends CFAbstractAnalysis<V,S,T>> factory, List<Pair<VariableElement,V>> fieldValues)
public List<Pair<VariableElement,V>> getFieldValues()
public T createTransferFunction()
public abstract S createEmptyStore(boolean sequentialSemantics)
public abstract S createCopiedStore(S s)
s.public abstract V createAbstractValue(AnnotatedTypeMirror type)
type.public CFValue defaultCreateAbstractValue(CFAbstractAnalysis<CFValue,?,?> analysis, AnnotatedTypeMirror type)
createAbstractValue(AnnotatedTypeMirror) that takes care of
invalid types.public TypeHierarchy getTypeHierarchy()
public GenericAnnotatedTypeFactory<V,S,T,? extends CFAbstractAnalysis<V,S,T>> getTypeFactory()
public void outputToDotFile(String outputFile, boolean verbose)
public V createSingleAnnotationValue(AnnotationMirror anno, TypeMirror underlyingType)
anno, and 'top' for all other hierarchies. The
underlying type is Object.public <W extends GenericAnnotatedTypeFactory<?,?,?,?>,U extends BaseTypeChecker> W getTypeFactoryOfSubchecker(Class<U> checkerClass)