Unformatted text preview: ‘C——_—-———_.————————————— 53725;! kappa EWQH
1/2/ Fall 2007 Advanced Theory of Programming Languages
Test #1 Name 1. (20 points)
_..a')’ Draw a picture that explains the relation (8’ 9 T’) <: (S 9 T). I D b) Give a code segment in CH- or Java that requires the relation to be true (even though
that code may not compile properly!) Be sure to highlight that portion of your code relevant to the relation and its usage. I? J. (10) Explain what the notation (((W, X) 9 Y) 9 Z) 9 <(S 9 T), (U 9 V)> means. I
7 33/ (10) In “How Do I Correctly Implement the equals( ) Method?”, Tal Cohen claims that equals( ) must satisfy certain properties. Name and deﬁne these properties. 51'. (20) The following function is given in the untyped k-calculus: kalba (b ﬂs tru) b
What does the ﬁmction do and what is its common name? You may assume that the l 0 function is applied to the Booleans tru and/or ﬂs. Show the work you used to determine your answer. “VS. (20) Deﬁne Pair in the following way: 6 Pair := laththIa b
Head := Ag.g(7ta_?tb.a)
Tail := lggOtaJLbb) Prove the correctness of these deﬁnitions for Tail(Pa.ir p q). Be sure to underline that part
of the expression involved in each evaluation. 6 (20) Write the type-checking rule in ; :
3/ 0 state ment using the same rule format as used for Conditional. Be careful Conditional 5 l- B: Boolean, 8 l— M: T, 8 l- N: T
Sl—ithheMMlelsefN}: T 7. (Extra credit — 3 points) Give the name or the Unicode value for l- or |-.
ow it is used is not worth any credit) 0 (calling it “half-ladder” or describing h ...
View Full Document
- Spring '10
- Dr. Thomas