Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456 Viktor Vafeiadis - Supervisions
Viktor Vafeiadis
Semantics of Programming Languages
First Supervision
Explain the term 'semantics'. Which three types of semantics are
useful for programming languages.
Why are type systems useful? Give an example of a program in L1
that fails. Prove that it is not typeable.
(a) What is meant by progress, type preservation and
safety.
(b) Consider a language L0 containing only boolean and integer constants,
integer addition, and if expressions. Give the form of the
typing jugdment and the reduction relation for terms in L0.
Give full typing rules and small-step operational semantics for L0.
Is L0's type-checking decidable? What about typeability?
(c) Show that the expression if true then 1 + 2 else 4 is
well typed. Show its evaluation.
(d) State and prove a safety theorem for your language.
Do exercises 1, 2, 8, 10 from page 39 of the lecture notes.
Second Supervision
Define terms in simply-typed lambda-calculus
(i.e. expressions consisting of variables, integer constants,
functions abstractions, function applications,
but no operations on store).
Write down typing rules.
Explain alpha-conversion, de Bruijn indices and substitution.
Explain the difference between call by value,
call-by-name, and call by need.
Give operational semantics for call by value and call by
name. How can we model call by need?
State progress, type preservation and
safety theorems for lamda-calculus.
Briefly explain how we can extend our language to support
features such as:
recursion, mutual recursion, tuples, records, ML datatypes,
and lists.
Third Supervision
Explain the terms covariance, contravariance and invariance
with respect to sub-typing. Give an example for each.
year 2003 paper 6 question 12 (subtyping)
year 2004 paper 6 question 11 (semantic equivalence)
year 2003 paper 5 question 11 (L2)
year 2004 paper 5 question 11 (L2)