-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhw5_output.txt
227 lines (226 loc) · 3.39 KB
/
hw5_output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
{\rtf1\ansi\ansicpg1252\cocoartf1265
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
\f0\fs24 \cf0 run:\
( : List start\
define : Reserved word.\
deriv : Word\
( : List start\
lambda : Reserved word.\
( : List start\
poly : Word\
var : Word\
) : List end\
( : List start\
let* : Reserved word.\
( : List start\
( : List start\
terms : Word\
( : List start\
terminize : Word\
poly : Word\
) : List end\
) : List end\
( : List start\
deriv-term : Word\
( : List start\
lambda : Reserved word.\
( : List start\
term : Word\
) : List end\
( : List start\
cond : Reserved word.\
( : List start\
( : List start\
null? : Word\
term : Word\
) : List end\
' : Reserved word.\
( : List start\
) : List end\
) : List end\
( : List start\
( : List start\
not : Reserved word.\
( : List start\
member? : Word\
var : Word\
term : Word\
) : List end\
) : List end\
' : Reserved word.\
( : List start\
0 : Number\
) : List end\
) : List end\
( : List start\
( : List start\
not : Reserved word.\
( : List start\
member? : Word\
' : Reserved word.\
term : Word\
) : List end\
) : List end\
( : List start\
upto : Word\
var : Word\
term : Word\
) : List end\
) : List end\
( : List start\
else : Reserved word.\
( : List start\
deriv-term-expo : Word\
term : Word\
var : Word\
) : List end\
) : List end\
) : List end\
) : List end\
) : List end\
( : List start\
diff : Word\
( : List start\
map : Word\
deriv-term : Word\
terms : Word\
) : List end\
) : List end\
) : List end\
( : List start\
remove-trailing-plus : Word\
( : List start\
polyize : Word\
diff : Word\
) : List end\
) : List end\
) : List end\
) : List end\
) : List end\
( : List start\
define : Reserved word.\
terminize : Word\
( : List start\
lambda : Reserved word.\
( : List start\
poly : Word\
) : List end\
( : List start\
cond : Reserved word.\
( : List start\
( : List start\
null? : Word\
poly : Word\
) : List end\
' : Reserved word.\
( : List start\
) : List end\
) : List end\
( : List start\
else : Reserved word.\
( : List start\
cons : Word\
( : List start\
upto : Word\
' : Reserved word.\
poly : Word\
) : List end\
( : List start\
terminize : Word\
( : List start\
after : Word\
' : Reserved word.\
poly : Word\
) : List end\
) : List end\
) : List end\
) : List end\
) : List end\
) : List end\
) : List end\
\
********PRINTING SYMBOL TABLE********\
^\
deriv\
deriv-term\
deriv-term-expo\
diff\
map\
member?\
null?\
poly\
polyize\
remove-trailing-plus\
term\
terminize\
terms\
upto\
var\
\
********PRINTING TREE********\
\
(define deriv \
(lambda \
(poly var)\
(let* \
(\
(terms \
(terminize poly))\
(deriv-term \
(lambda \
(term)\
(cond \
(\
(null? term)' () )\
(\
(not \
(member? var term))' \
(0))\
(\
(not \
(member? ' ^ term))\
(upto var term))\
(else \
(deriv-term-expo term var)))))\
(diff \
(map deriv-term terms)))\
(remove-trailing-plus \
(polyize diff)))))\
********PRINTING SYMBOL TABLE********\
+\
^\
after\
cons\
deriv\
deriv-term\
deriv-term-expo\
diff\
map\
member?\
null?\
poly\
polyize\
remove-trailing-plus\
term\
terminize\
terms\
upto\
var\
\
********PRINTING TREE********\
\
(define terminize \
(lambda \
(poly)\
(cond \
(\
(null? poly)' () )\
(else \
(cons \
(upto ' + poly)\
(terminize \
(after ' + poly)))))))BUILD SUCCESSFUL (total time: 0 seconds)\
}