Rewrite eval so that the dispatch is done in data-directed


Rewrite eval so that the dispatch is done in data-directed style. Compare this with the data-directed differentiation procedure of exercise 2.73. (You may use the car of a compound expression as the type of the expression, as is appropriate for the syntax implemented in this section.) exercise 2.73 Section 2.3.2 described a program that performs symbolic differentiation

1020_kk.jpg

We can regard this program as performing a dispatch on the type of the expression to be differentiated. In this situation the ``type tag'' of the datum is the algebraic operator symbol (such as +) and the operation being performed is deriv. We can transform this program into data- irected style by rewriting the basic derivative procedure as samevariable? into the data-directed dispatch?

b. Write the procedures for derivatives of sums and products, and the auxiliary code required to install them in the table used by the program above.

c. Choose any additional differentiation rule that you like, such as the one for exponents (exercise 2.56), and install it in this data-directed system. d. In this simple algebraic manipulator the type of an exp ession is the algebraic operator that binds it together. Suppose, however, we indexed the procedures in the opposite way, so that the dispatch line in deriv looked like
((get (operator exp) 'deriv) (operands expvar) What corresponding changes to the derivative system are required?

Request for Solution File

Ask an Expert for Answer!!
Basic Statistics: Rewrite eval so that the dispatch is done in data-directed
Reference No:- TGS01387510

Expected delivery within 24 Hours