

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Practice problems for a computer science course, specifically for the topics of programming languages, polymorphism, multithreading, lambda calculus, operational semantics, markup languages, and garbage collection. The problems cover various concepts such as ad-hoc and parametric polymorphism, starvation and deadlock, functional programming, html and xml, query languages, and programming languages, among others.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


public class MyBarrier { public void MyBarrier (int n) { … } public enter( ) { … } public reset( ) { … } }
b. Implement MyBarrier using Ruby monitors. c. Write a Ruby program that creates a barrier for 2 threads, then creates 2 threads that each print out “hello”, enters the barrier, then prints out “goodbye”.
Find all free (unbound) variables in the following λ-expressions d. λx.x z λy.x y e. (λx. x z) λy. w λw. w y z x f. λx. x y λx. y x Apply β-reduction to the following λ-expressions as much as possible g. (λz.z) (λy.y y) (λx.x a) h. (λz.z) (λz.z z) (λz.z y) i. (λx.λy.x y y) (λa.a) b j. (λx.λy.x y y) (λy.y) y k. (λx.x x) (λy.y x) z l. (λx. (λy. (x y)) y) z m. ((λx.x x) (λy.y)) (λy.y) n. (((λx. λy.(x y))(λy.y)) w)
Show that the following expression has multiple reduction sequences o. (λx.y) ((λy.y y y) (λx.x x x))