Go backward to
Denotational Semantics
Go up to
Top
Go forward to
Subtyping of Function Types
Extension of Subtyping
Other parts of programming language:
Subtyping on modules.
pi
1
dec
<=
pi
2
dec
if
pi
1
<=
pi
2
fun
A=2,
proc
A=
skip
{A:
intexp
}
dec
<= {}
dec
{A:
comm
}
dec
<= {}
dec
{A:
intexp
}
dec
or {A:
comm
}
dec
?
Two different incorrect typings!
Function types:
theta
11
->
theta
12
<=
theta
21
->
theta
22
if
theta
21
<=
theta
11
and
theta
12
<=
theta
22
Contravariance
of argument and result types!
Example:
TRUNC:
realexp
->
intexp
Result can be extended to
realexp
Argument can be extended to
realexp
TRUNC:
intexp
->
realexp
!
Author:
Wolfgang Schreiner
Last Modification: May 14, 1998