Question 1 @ 2022-03-01 18:23
The Schlac language has the following primitive values…
(select all that apply)
- Numbers
- Strings
- Booleans
- Symbols
- Nulls
- Functions
- Function applications
Question 2 @ 2022-03-01 18:27
We can express the Lambda Calculus language (similar to our Schlac)
using this BNF:
<lambda-expr> ::= x
| λx . <lambda-expr>
| <lambda-expr> <lambda-expr>
What is the name of the last BNF rule?
- Abstraction
- Application
- Recursion
- Variable binding
- Beta-reduction
Question 3 @ 2022-03-01 18:29
Which of the following is the result of an α-conversion of the following
expression?
(lambda (x y) x)
-
(lambda (a b) b)
-
(lambda (p q) p)
-
(f (n) n)
-
(lambda (f n) n)
Question 4 @ 2022-03-01 18:30
What is true about the following Church encoding?
(lambda (f) (lambda (n) n))
- This is the Church numeral that encodes the number 0.
- This is the Church numeral that encodes the number 1.
- This is the Church-encoded false boolean.
- This is the Church-encoded true boolean.
- This expression cannot be simplified further.
- This encoding represents the identity function.
- The function f is applied to the identity function once.
Question 5 @ 2022-03-01 18:33
Which of the following encoded values represents the identity function
in our Schlac code?
Reminder:
(define 0 (lambda (f x) x))
(define 1 (lambda (f x) (f x)))
(define #t (lambda (x y) x))
(define #f (lambda (x y) y))
-
0
-
1
-
#t
-
#f
- The identity function is not represented as a Church numeral.