Unformatted text preview: t, or
2. it is a pair whose car is a integer and whose cdr is a list of integers.
We use Int to denote the set of all integers, and ListofInt to denote the set of
lists of integers.
Deﬁnition 5 (list of integers, bottomup) The set ListofInt is the smallest set
of Scheme lists satisfying the following two properties: ¢ ¢ ¢ l ListofInt. The phrase n ListofInt, then n Int and l 2. if n ListofInt, and ¢ 1. l denotes a Scheme list whose car is n and whose cdr is l . Deﬁnition 6 (list of integers, rules of inference) ¢ Int
(n l ) ListofInt ¢ ¡ ¢ n ¢ () l ListofInt
ListofInt 7 1. is a list of integers, because of property 1 of deﬁnition 5 or the ﬁrst rule
of deﬁnition 6. 2. is a list of integers, because of property 2 of deﬁnition 5, since
is a integer and
is a list of integers. We can also write this as an
instance of the second rule for ListofInt .
¢ ¢
¡
¢ ¡
¢ ¡
¢
ListofInt
ListofInt A
¡
¢ A is a list of integers, because of property 2, since is a
integer and...
View
Full Document
 Fall '09
 Data Structures, eopl, ¡§ £¡, Dr. Wand

Click to edit the document details