Go backward to
Bounded Quantification
Go up to
Top
Go forward to
Bounded Quantification 'n Subtyping
Record Types and Inheritance
Record type:
{
a
1
:t1,...,a
n
:t
n
,...,a
m
:t
m
} <= {
a
1
:u
1
,...,
a
n
:u
n
} iff
t
i
<=
u
i
(for
i
in 1 ...n)
A
is subtype of
B
if
A
has all the fields of
B
(possibly more) and the types of the common fields are subtypes.
Concept of
inheritance
(
subclasses
)
Records may have functional components.
Class instance is record with functions and local variables.
Subclass instance is record with at least those functions and variables.
Variant types:
[
a
1
:t1,...,a
n
:t
n
]
<= [
a
1
:u
1
,...,a
n
:u
n
,...,a
m
:u
m
] iff
t
i
<=
u
i
(for
i
in 1 ...n)
Author:
Wolfgang Schreiner
Last Modification: May 27, 1998