Go backward to
Dynamically Scoped Objects
Go up to
Top
Go forward to
Minimal Types
Subtyping
Typing system that formalizes subtyping:
Type attributes
theta
1
<=
theta
2
theta
1
is
subtype
of
theta
2
Phrase of type
theta
1
can be used in any context that demands phrase of type
theta
2
.
<= is
reflexive
and
transitive
.
Example: mixed mode arithmetic.
int
<=
real
tau
1
<=
tau
2
=>
tau
1
exp
<=
tau
2
exp
.
Typing rules:
pi
|- E:
theta
1
pi
|- E:
theta
2
if
theta
1
<=
theta
2
pi
|- E
1
:
tau
exp
pi
|- E
2
:
tau
exp
pi
|- E
1
+E
2
:
tau
exp
pi
|- E:
tau
pi
|- E:
tau
exp
tau
in{
int
,
real
}
pi
|- N:
int
pi
|- N
1
.N
2
:
real
Author:
Wolfgang Schreiner
Last Modification: May 14, 1998