[Checkers] Comments on Prototype hierarchy

Mahmood Ali mahmood at MIT.EDU
Tue Jun 2 14:39:29 EDT 2009


Greetings,

> 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.

> That sounds possibly reasonable.  Should it be built into every  
> checker by
> default, including the basic checker?  Should it have a standard name?
I think that the proper solution to output a debugging statement if a  
single bottom doesn't exist.  The bottom values differ depending on  
the checker.

> I see @Prototype as as aberration.  Any use must be explicitly  
> noted, even
> in a method body.  I am happy that
>    Invariant inv = new @Prototype Invariant(...);
> is invalid.  This should be written as
>    @Prototype Invariant inv = new @Prototype Invariant(...);
>
Sounds good with me.

     Mahmood




More information about the checkers mailing list