CS 6520 Homework 23
Exercise 23.1
Produce a continuation [denotational] semantics for the following language:
a
=
0
| (
add1
a
) | (
mkaddr
a
) | (
a
a
)
Informally, the intended semantics is as follows:
0
is zero
(
add1
a
) adds one to
a
.
(
mkaddr
a
) creates an adder that adds
a
to a given number.
(
a
1
a
2
) applies the adder
a
1
to the number
a
2
.
Using
add1
on a non-number produces
error
1
.
Using
mkaddr
on a non-number produces
error
m
.
Applying a non-adder produces
error
a
.
Applying an adder to a non-number produces
error
+
.
Last update: Tuesday, April 18th, 2000
mflatt@cs.utah.edu