Matching Exercise
FOR A SAMPLE EXPLANATION OF MATCH, GO HERE.
(match '((* x) wild (? y)) '(* specifies a wild card))
Trace this call to Match. Show each value for P and S. Tell how many times
Match was called, including the first time. Show all side effects as they
occur.
1. P = _____________________ S = ______________________
2. The first successful subfunction call is: (_________________)
P = _________________________ S = ___________________
Subcase __: Recursive call: (match _______________________)
3. Next Subfunction call: (___________________)
P = ____________________________ S = _________________________
Subcase __: Recursive call: (match ____________________________)
4. Next Subfunction call: (_____________________)
P = __________________________ S= ______________________________
Subcase __: Recursive call: (match _______________________________)
5. Next Subfunction call: (___________________________)
P = __________________ S = ______________________
Element _________ in P Matches with Element ___________ in S
Recursive Call (match ______________________________)
6. Next Subfunction call: (_____________________)
P = _______________ S = ________________
Recursive Call: (match ______________________________)
7. Subfuntion (_______________________)
P = __________ S = ________ Return to #6 the assoc list: (___________)
8. 6 returns to 5 ((____________) (:YES . :YES))
9. 5 returns to 4 ((____________) (:YES . :YES))
10. 4 returns to 3 ((_________) (___________) (:YES . :YES))
11. 3 returns to 2 ((_______________) (_____________) (:YES . :YES))
12. 2 returns to 1 ((__________________) (_______________) (:YES . :YES))
Including the first call, how many calls to MATCH are there? ______