Lecture 10 Notes

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

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

View Full Document Right Arrow Icon
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. Definition 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 .  Definition 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 definition 5 or the first rule of definition 6. 2. is a list of integers, because of property 2 of definition 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

This document was uploaded on 03/17/2014 for the course CSG 111 at Northeastern.

Ask a homework question - tutors are online