Question
these questions are about LISP please explain the reason In the following Fun language example, which expressions can we get by some series of reductions?
these questions are about LISP
please explain the reason
In the following Fun language example, which expressions can we get by some series of reductions? Assume that we can reduce the built-in function + in the usual way that addition works.
Definitions:
f(x, y) = x+y
g(x) = x+1
h(x) = 7
Example:
f(g(h(4)), h(g(5)))
1.Select all that apply:
a. g(h(4)) + h(g(5))
b. f(g(7), h(g(5)))
c. f(8, 7)
d. 15
e. f(g(h(4)) + h(g(5)))
f. f(5, h(g(5)))
g. f(h(g(4)), g(h(5)))
h. 42
2.In ((lambda (x) (x 2)) (lambda (z) (+ z 1))) we can choose both orders of reduction: reduce lambda (x)... first, or lambda (z)... first T or F
3. Assume that a sequence of reductions leads to a normal form. Then none of the intermediate expressions before the last reduction was in normal form T or F
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started