You are on page 1of 2

Homework #3

CS520 / KAIST Fall 2017

Due: October 11, 2017 9:00AM

1. (10 pts) Consider the expressions defined by the following abstract syntax:
e 0 | 3 | e+e | e*e
where + and * are addition and multiplication, respectively.
(a) Define the denotational semantics of e precisely. You need to state what are the domain
of meaning and the signature of semantic function.
(b) Show by structural induction that every expressions value is the multiple of 3.

2. (10 pts) For expressions of the previous syntax, suppose that we want to check whether an
expression e will compute an even number. Design a set of inference rules for judgement
even(e) that is sound, i.e. if we can conclude by using the inference rules that even(e)
then the expressions result must be an even number. You have to prove that your inference
system is sound. Is your system complete? If yes, prove it. Otherwise, show a counter
example.

3. (10 pts)
4. (10 pts) Consider the following simple integer-expressions:

You might also like