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).
- Monday
- π
- HelloWorld!
- --1
- -1
- *PI*
- 31415x10**-4
- (A . B . C)
- Hello World!
- if
- invokevirtual
- ((1) . (2))
- <=
- ((A . 1) (B . 2) (C . 3))
- Hello_World!
- +
- lo-part
- 31415926535897932384626433832795028841971693993751058209749445923
- (1 . (2 . 3))
- (1 . 2 3)
- "Hello World!"
- ((1) (2) . 3)
- ()
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 . (2 3))
- (nil . (nil nil))
- ((nil nil) . nil)
- (1 (2 . 3) 4)
- (nil nil)
- (1 (2 . 3) . (4 . ()))
- (HelloWorld !)
- (1 (2 3 . ()) 4)
- ((A . t) (B . nil)(C . nil))
- (()())
- (1 2 3)
- (() () . nil)
- (A B C)
- (a . (b . (c)))
- (HELLO WORLD !)
- ((a . t) (b) . ((c)))
Next: Terms (or Table of Contents)