{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 10 Notes

# The phrase n list of int then n int and l 2 if

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

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 List-of-Int to denote the set of lists of integers. Deﬁnition 5 (list of integers, bottom-up) The set List-of-Int is the smallest set of Scheme lists satisfying the following two properties: ¢  ¢ ¢ l List-of-Int.  The phrase n List-of-Int, then n  Int and l 2. if n List-of-Int, 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 ) List-of-Int ¢ ¡ ¢ n ¢ () l List-of-Int List-of-Int 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 List-of-Int .    ¢ ¢    ¡ ¢ ¡ ¢ ¡ ¢    List-of-Int List-of-Int A   ¡ ¢ A is a list of integers, because of property 2, since is a integer and...
View Full Document

{[ snackBarMessage ]}