• Top
    • Documentation
    • Books
    • Recursion-and-induction
      • R-and-i-annotated-bibliography
      • R-and-i-definitions-revisited
      • R-and-i-terms
      • R-and-i-structural-induction
      • R-and-i-relations-between-recursion-and-induction
      • R-and-i-ordinals
      • R-and-i-inadequacies-of-structural-recursion
      • R-and-i-axioms
      • R-and-i-abbreviations-for-terms
      • R-and-i-terms-as-formulas
      • R-and-i-more-problems
      • R-and-i-still-more-problems
      • R-and-i-definitional-principle
      • R-and-i-function-definitions
      • R-and-i-introduction
      • R-and-i-table-of-contents
      • R-and-i-substitutions
      • R-and-i-arithmetic
      • R-and-i-induction-principle
      • R-and-i-data-types
        • R-and-i-pairs
        • R-and-i-data-types-exercises
          • R-and-i-symbols
          • R-and-i-identity
          • R-and-i-numbers
          • R-and-i-characters
          • R-and-i-strings
        • R-and-i-more-inadequacies-of-the-definitional-principle
      • Boolean-reasoning
      • Debugging
      • Projects
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • R-and-i-data-types

    R-and-i-data-types-exercises

    Recursion and Induction: Data Types Exercises

    Problem 1.
    Each of the utterances below is supposed to be a single object. Say whether it is a number, string, symbol, pair, or ill-formed (i.e., does not represent a single object in our language).

    1. Monday
    2. π
    3. HelloWorld!
    4. --1
    5. -1
    6. *PI*
    7. 31415x10**-4
    8. (A . B . C)
    9. Hello World!
    10. if
    11. invokevirtual
    12. ((1) . (2))
    13. <=
    14. ((A . 1) (B . 2) (C . 3))
    15. Hello_World!
    16. +
    17. lo-part
    18. 31415926535897932384626433832795028841971693993751058209749445923
    19. (1 . (2 . 3))
    20. (1 . 2 3)
    21. "Hello World!"
    22. ((1) (2) . 3)
    23. ()

    Problem 2.
    Group the constants below into equivalence classes. That is, some items below are equal to others even though they are displayed differently; group equal constants together.

    1. (1 . (2 3))
    2. (nil . (nil nil))
    3. ((nil nil) . nil)
    4. (1 (2 . 3) 4)
    5. (nil nil)
    6. (1 (2 . 3) . (4 . ()))
    7. (HelloWorld !)
    8. (1 (2 3 . ()) 4)
    9. ((A . t) (B . nil)(C . nil))
    10. (()())
    11. (1 2 3)
    12. (() () . nil)
    13. (A B C)
    14. (a . (b . (c)))
    15. (HELLO WORLD !)
    16. ((a . t) (b) . ((c)))

    Next: Terms (or Table of Contents)