|
| ||
|
|
Start of topic | Skip to actions
Homework 2 (Due Thursday 1/22/09 at 11:00 pm)Submit via OWLSPACE. "Zip" (compress) all your solution files into one file and submit this one compressed file. A "Natural number" (natural) in this assignment means the type defined in the text. Your file should include a data definition for natural. Unless the problem statement stipulates otherwise, the only built-in operations you may use with values of this type or variants (such as natural[>=1]) are the constructors, accessor, and recognizers for the type and the equal? operation. For natural, the constructor is add1; the accessor is sub1, and he recognizers are zero? and positive?.
For variants, the constructor is typically add1 (unless the variant consists of multiples of m for m>1 such as the even numbers for which the constructor is add2), the accessor is typically sub1 (subk if the constructor is addk), and the recognizers are typically is (equal? ... k), where k is the base number (zero? for natural), and (> ... k) (positive for natural).
Problems from the book (HTDP) with some customization:
Topic Actions: Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r13 < r12 < r11 < r10 < r9 | More topic actions
Webs: Main | TWiki | Africa | CPSX | EmbeddedSystems | Gpce | Houston | International | K12 | MetaOCaml | MulticoreOCR | ProgrammingLanguages | RAP | RIDL | Sandbox | SpeechClub | Teaching | Texbot | WG211 Web Actions: | |
This work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.