31.2 Definitions

 < Free Open Study > 



31.2 Definitions

The rules defining are listed in Figure 31-1. One technicality in the definition is that, although the system provides two different sorts of binding for type variables (X::K in type operators and X<:T in quantifiers), we allow only the latter form of binding in contexts. When we move an X::K binder from the right-hand side of the turnstile to the left, in rules K-ABS and S-ABS, we change it to X<:Top[K].

Another fine point is that the rules S-REFL from F<: and T-EQ from Fω are dropped in . Instances of the old S-REFL are immediate consequences of S-EQ and Q-REFL, while T-EQ is derivable from T-SUB and S-EQ.

31.2.1 Exercise []

If we define Id = λX.X and

   Г = B<:Top, A<:B, F <: Id 

then which of the following subtype statements are derivable?

    Г    A                         <:  Id B    Г    Id A                      <:  B    Г    λX.X                      <:  λX.Top    Г    λX. "Y<:X. Y              <:  λX. "Y<:Top. Y    Г    λX. "Y<:X. y              <:  λX. "Y<:X. X    Г    FB                        <:  B    Г    B                         <:  FB    Г    FB                        <:  FB    Г    "F<:(λY.TopY). FA        <:  "F<:(λY.TopY). TopB    Г    "F<:(λY.TopY). FA        <:  "F<:(λY.TopY). F B    Г    Top[**]                  <:  Top[***] 



 < Free Open Study > 



Types and Programming Languages
Types and Programming Languages
ISBN: 0262162091
EAN: 2147483647
Year: 2002
Pages: 262

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net