Class IndexAbstractTransfer
java.lang.Object
org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor<TransferResult<CFValue,CFStore>,TransferInput<CFValue,CFStore>>
org.checkerframework.framework.flow.CFAbstractTransfer<CFValue,CFStore,CFTransfer>
org.checkerframework.framework.flow.CFTransfer
org.checkerframework.checker.index.IndexAbstractTransfer
- All Implemented Interfaces:
ForwardTransferFunction<CFValue,,CFStore> TransferFunction<CFValue,,CFStore> NodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
- Direct Known Subclasses:
LessThanTransfer,LowerBoundTransfer,SearchIndexTransfer,UpperBoundTransfer
This class provides methods shared by the Index Checker's internal checkers in their transfer
functions. In particular, it provides a common framework for visiting comparison operators.
-
Field Summary
Fields inherited from class org.checkerframework.framework.flow.CFAbstractTransfer
analysis, sequentialSemantics -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanisFloatingPointComparison(Node left, Node right) Returns true if the comparison of the given operands is a floating-point comparison: that is, if an operand has a floating-point type, primitive or boxed.protected abstract voidrefineGT(Node left, AnnotationMirror leftAnno, Node right, AnnotationMirror rightAnno, CFStore store, TransferInput<CFValue, CFStore> in) Refines the given store, given thatleft > rightholds in it.protected abstract voidrefineGTE(Node left, AnnotationMirror leftAnno, Node right, AnnotationMirror rightAnno, CFStore store, TransferInput<CFValue, CFStore> in) Refines the given store, given thatleft >= rightholds in it.visitGreaterThan(GreaterThanNode node, TransferInput<CFValue, CFStore> in) visitLessThan(LessThanNode node, TransferInput<CFValue, CFStore> in) Methods inherited from class org.checkerframework.framework.flow.CFAbstractTransfer
addInformationFromPreconditions, createTransferResult, createTransferResult, finishValue, finishValue, getNarrowedValue, getValueFromFactory, getWidenedValue, initialStore, insertIntoStores, insertIntoStoresPermitNonDeterministic, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, processPostconditions, recreateTransferResult, recreateTransferResult, refineCaseLabelBindingVariable, setFixedInitialStore, shouldPerformWholeProgramInference, shouldPerformWholeProgramInference, splitAssignments, strengthenAnnotationOfEqualTo, usesSequentialSemantics, visitAnyPattern, visitArrayAccess, visitAssignment, visitCase, visitClassName, visitConditionalNot, visitDeconstructorPattern, visitEqualTo, visitExpressionStatement, visitFieldAccess, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitMethodInvocation, visitNarrowingConversion, visitNode, visitNotEqual, visitObjectCreation, visitReturn, visitStringConversion, visitSwitchExpressionNode, visitTernaryExpression, visitThis, visitVariableDeclaration, visitWideningConversionMethods inherited from class org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift, visitValueLiteralMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.dataflow.cfg.node.NodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift
-
Constructor Details
-
IndexAbstractTransfer
-
-
Method Details
-
visitGreaterThan
public TransferResult<CFValue,CFStore> visitGreaterThan(GreaterThanNode node, TransferInput<CFValue, CFStore> in) - Specified by:
visitGreaterThanin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitGreaterThanin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitGreaterThanOrEqual
public TransferResult<CFValue,CFStore> visitGreaterThanOrEqual(GreaterThanOrEqualNode node, TransferInput<CFValue, CFStore> in) - Specified by:
visitGreaterThanOrEqualin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitGreaterThanOrEqualin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitLessThanOrEqual
public TransferResult<CFValue,CFStore> visitLessThanOrEqual(LessThanOrEqualNode node, TransferInput<CFValue, CFStore> in) - Specified by:
visitLessThanOrEqualin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLessThanOrEqualin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitLessThan
public TransferResult<CFValue,CFStore> visitLessThan(LessThanNode node, TransferInput<CFValue, CFStore> in) - Specified by:
visitLessThanin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLessThanin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
isFloatingPointComparison
Returns true if the comparison of the given operands is a floating-point comparison: that is, if an operand has a floating-point type, primitive or boxed. Such a comparison differs from an integral comparison in two ways.- An operand of such a comparison might be NaN. Every comparison with NaN is false, so the
else branch of such a comparison does not imply the inverse comparison: if
dis NaN, then bothi > dandi <= dare false. - The comparison converts an integral operand to a floating-point type, which might round
it. If the
floatfis 16777216.0f and theintiis 16777217, thenf >= iis true, becauseirounds to 16777216.0f, buti < f + 1is false. A strict comparison is not affected, because rounding is monotonic: iff > iis true, then so isi < f.
- Parameters:
left- the left operand of a numerical comparisonright- the right operand of the comparison- Returns:
- true if the comparison of
leftandrightis a floating-point comparison
- An operand of such a comparison might be NaN. Every comparison with NaN is false, so the
else branch of such a comparison does not imply the inverse comparison: if
-
refineGT
protected abstract void refineGT(Node left, AnnotationMirror leftAnno, Node right, AnnotationMirror rightAnno, CFStore store, TransferInput<CFValue, CFStore> in) Refines the given store, given thatleft > rightholds in it.- Parameters:
left- the greater operand of a comparisonleftAnno- the annotation on the type ofleftright- the lesser operand of the comparisonrightAnno- the annotation on the type ofrightstore- the store to refine, in whichleft > rightholdsin- the input to the transfer function for the comparison
-
refineGTE
protected abstract void refineGTE(Node left, AnnotationMirror leftAnno, Node right, AnnotationMirror rightAnno, CFStore store, TransferInput<CFValue, CFStore> in) Refines the given store, given thatleft >= rightholds in it.- Parameters:
left- the greater-or-equal operand of a comparisonleftAnno- the annotation on the type ofleftright- the lesser-or-equal operand of the comparisonrightAnno- the annotation on the type ofrightstore- the store to refine, in whichleft >= rightholdsin- the input to the transfer function for the comparison
-