observe that our model of evaluation allows for


Observe that our model of evaluation allows for combinations whose operators are compound expressions.

(a) Use this observation to describe the behavior of the following procedure:

(define (a-or-b-depending-on-value a b)
((cond ((< b a) +) ((= b 0) -) ((= a 0) /) (else *)) a b))

Your answer should describe what happens for all integer values of a and b. Illustrate your answer using the substitution model assuming applicative order evaluation.

(b) Write a procedure (check-it op p q r) that returns #t if p op q = r and #f otherwise. For example, (check-it * 3 2 6) would return #t as 3 * 2 = 6.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: observe that our model of evaluation allows for
Reference No:- TGS0219172

Expected delivery within 24 Hours