What are the answers for the non-recursive cond clauses? |
The examples should tell you which values you need here. If not, formulate appropriate examples and tests. |
What do the selector expressions in the recursive clauses compute? |
The data definitions tell you what kind of data these expressions extract and the interpretations of the data definitions tell you what this data represents. |
What do the natural recursions compute |
Use the purpose statement of the function to determine what the value of the recursion means not how it computes this answer. If the purpose statement doesn’t tell you the answer, improve the purpose statement. |
How can you combine these values into the desired answer? |
If you are stuck here, arrange the examples from the third step in a table. Place the given input in the first column and the desired output in the last column. In the intermediate columns enter the values of the selector expressions and the natural recursion(s). Add examples until you see a pattern emerge that suggests a ``combining’’ function. |