[Checkers] Bottom type qualifier

Mahmood Ali mahmood at MIT.EDU
Tue Jun 2 16:26:14 EDT 2009


Greetings,

Sorry, I forgot about the difference between programmer and type  
system designer.  I cannot think of a single case where the programmer  
explicitly write the annotation.  That's why I wanted the explicit  
bottom qualifier to be a package scope annotation.

Needless to say that in the cases with a single-line hierarchy (e.g.  
interning, nullness), the bottom qualifier (e.g. Interned, NonNull)  
needs to be public.

- Mahmood

On Jun 2, 2009, at 4:05 PM, Michael Ernst wrote:

> Mahmood-
>
>>> When in particular does a programmer want to use the bottom  
>>> qualifier?
>>> I believe you, but some concrete examples would be useful.
>>
>> In practice, this is an issue under two conditions:
>> 1. typical condition: There is a value that is a subtype of
>> everything, e.g. null value for most checkers.
>> 2. additional condition: the hierarchy is not a single-line  
>> hierarchy,
>> i.e. there are some incomparable qualifiers.  Otherwise, a bottom
>> exists by default.
>>
>> As for examples, the only one I can think of now is handling null in
>> almost all checkers (e.g. IGJ, Prototype-NonPrototype-PrototypeOrNot,
>> Trusted-Tainted-TaintedOrNot).
>>
>> I can see how numerical literals would be bottom values as well for
>> some unit qualifiers, e.g. DistanceInMile-DistanceInKm.
>
> These feel like examples where the user should not have to write a  
> type.
> So keeping the bottom type private might be sufficient, so long as the
> checker can use it internally.  In this case, the type system designer
> wouldn't even have to create it explicitly.
>
> I was really asking for examples where a programmer needs to write the
> bottom type qualifier.  Do such examples exist?
>
>                     Thanks,
>
>                    -Mike




More information about the checkers mailing list