protected class AccumulationAnnotatedTypeFactory.AccumulationQualifierHierarchy extends MultiGraphQualifierHierarchy
acc()
/ \
acc(x) acc(y) ...
\ /
acc(x,y) ...
|
bottom
Predicate subtyping is defined as follows:
Acc(A) is a subtype of AccPred("A || B"), because when A is replaced with true and B is replaced with
false, the resulting boolean formula evaluates to true.
AccumulationAnnotatedTypeFactory.isPredicateSubtype(String, String)) is provided to allow more complex
subtyping behavior between predicates. (The "correct" subtyping rule is that P is a
subtype of Q iff P implies Q. That rule would require an SMT solver in the general
case, which is undesirable because it would require an external dependency. A user can
override AccumulationAnnotatedTypeFactory.isPredicateSubtype(String, String) if they require more precise
subtyping; the check described here is overly conservative (and therefore sound), but
not very precise.)
MultiGraphQualifierHierarchy.MultiGraphFactorybottoms, polyQualifiers, supertypesDirect, supertypesTransitive, tops| Constructor and Description |
|---|
AccumulationQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory factory)
Create the qualifier hierarchy.
|
| Modifier and Type | Method and Description |
|---|---|
AnnotationMirror |
getTopAnnotation(AnnotationMirror start)
Return the top qualifier for the given qualifier, that is, the qualifier that is a supertype
of
qualifier but no further supertypes exist. |
AnnotationMirror |
greatestLowerBound(AnnotationMirror a1,
AnnotationMirror a2)
GLB in this type system is set union of the arguments of the two annotations, unless one
of them is bottom, in which case the result is also bottom.
|
boolean |
isSubtype(AnnotationMirror subAnno,
AnnotationMirror superAnno)
isSubtype in this type system is subset.
|
AnnotationMirror |
leastUpperBound(AnnotationMirror a1,
AnnotationMirror a2)
LUB in this type system is set intersection of the arguments of the two annotations,
unless one of them is bottom, in which case the result is the other annotation.
|
addPolyRelations, findBottoms, findLub, findTops, finish, getBottomAnnotation, getBottomAnnotations, getPolymorphicAnnotation, getTopAnnotations, isPolymorphicQualifier, isSubtype, isValid, toString, transitiveClosureclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitassertSameSize, assertSameSize, canHaveEmptyAnnotationSet, findAnnotationInHierarchy, findAnnotationInSameHierarchy, getWidth, greatestLowerBound, greatestLowerBounds, greatestLowerBounds, greatestLowerBoundsTypeVariable, greatestLowerBoundTypeVariable, isSubtype, isSubtype, isSubtypeTypeVariable, isSubtypeTypeVariable, leastUpperBound, leastUpperBounds, leastUpperBounds, leastUpperBoundsTypeVariable, leastUpperBoundTypeVariable, numberOfIterationsBeforeWidening, updateMappingToMutableSet, widenedUpperBoundpublic AccumulationQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory factory)
factory - the factorypublic AnnotationMirror getTopAnnotation(AnnotationMirror start)
QualifierHierarchyqualifier but no further supertypes exist.getTopAnnotation in interface QualifierHierarchygetTopAnnotation in class MultiGraphQualifierHierarchystart - any qualifier from one of the qualifier hierarchies represented by thisqualifier's hierarchypublic AnnotationMirror greatestLowerBound(AnnotationMirror a1, AnnotationMirror a2)
greatestLowerBound in interface QualifierHierarchygreatestLowerBound in class MultiGraphQualifierHierarchya1 - first qualifiera2 - second qualifierpublic AnnotationMirror leastUpperBound(AnnotationMirror a1, AnnotationMirror a2)
leastUpperBound in interface QualifierHierarchyleastUpperBound in class MultiGraphQualifierHierarchya1 - the first qualifier; may not be in the same hierarchy as qualifier2a2 - the second qualifier; may not be in the same hierarchy as qualifier1null if the qualifiers are from
different hierarchiespublic boolean isSubtype(AnnotationMirror subAnno, AnnotationMirror superAnno)
isSubtype in interface QualifierHierarchyisSubtype in class MultiGraphQualifierHierarchysubAnno - the sub qualifiersuperAnno - the super qualifiersubQualifier is a subqualifier of, or equal to, superQualifier