DOC PREVIEW
UVA CS 150 - Lecture 40: Computing with Glue and Photons

This preview shows page 1-2-15-16-17-32-33 out of 33 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Lecture 40 Computing with Glue and Photons I will have extra office hours after class Friday 1 3pm in addition to the normal office The Tinkertoy Computer and Other Machinations hours after class by A K Dewdney Wednesday CS150 Computer Science and Thursday 3 30University of Virginia David Evans 4 30 Computer Science http www cs virginia edu evans http www amazon com exec obidos tg detail 071672491X 103 4408705 5367831 v glance Equivalent Computers z z z z z z z X L R L 2 look for 1 Start X R 1 HAL T 0 where v does not occur in M x M N M x N Lambda Calculus Finite State Machine Turing Machine Lecture 40 Computing with Glue and Phot term variable term term term variable term y M v M y v 2 Lambda Calculus is a Universal Computer z z z z z z z z z X L R L 2 look for 1 Start X R 1 HAL T 0 Finite State Machine Lecture 40 Computing with Glue and Phot z z z z z z z z z z Read Write Infinite Tape Mutable Lists Finite State Machine Numbers Processing Way to make decisions if Way to keep going 3 z What is 42 42 XLII forty two cuarenta y dos Lecture 40 Computing with Glue and Phot 4 Meaning of Numbers 42 ness is something who s successor is 43 ness 42 ness is something who s predecessor is 41 ness Zero is special It has a successor one ness but no predecessor Lecture 40 Computing with Glue and Phot 5 Meaning of Numbers pred succ N N succ pred N N succ pred succ N succ N zero zero T zero succ zero F Lecture 40 Computing with Glue and Phot 6 Is this enough Can we define add with pred succ zero and zero add xy if zero x y add pred x succ y Lecture 40 Computing with Glue and Phot 7 Can we define lambda terms that behave like zero zero pred and succ Hint what if we had cons car and cdr Lecture 40 Computing with Glue and Phot 8 Numbers are Lists zero null pred cdr succ x cons F x The length of the list corresponds to the number value Lecture 40 Computing with Glue and Phot 9 Making Pairs define make pair x y lambda selector if selector x y define car of pair p p t define cdr of pair p p f Lecture 40 Computing with Glue and Phot 10 cons and car cons x y z zxy cons M N x y z zxy M N y z zMy N z zMN car p p T T xy x car cons M N car z zMN p p T z zMN z zMN T TMN xy x MN y M N M Lecture 40 Computing with Glue and Phot 11 cdr too cons xyz zxy car p p T cdr p p F cdr cons M N cdr z zMN p p F z zMN z zMN F FMN N Lecture 40 Computing with Glue and Phot 12 Null and null null x T null x x y z F null null x x y z F x T x T y z F T Lecture 40 Computing with Glue and Phot 13 Null and null null x T null x x y z F null cons M N x x y z F z zMN z z MN y z F y z F MN F Lecture 40 Computing with Glue and Phot 14 Counting 0 null 1 cons F 0 2 cons F 1 3 cons F 2 succ x cons F x pred x cdr x Lecture 40 Computing with Glue and Phot 15 42 xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy xy y xy z z xy Lecture 40 Computing with Glue and Phot 16 xy y x T Lambda Calculus is a Universal Computer z z z z z z z z z z z z z z z z z z z z X L R L 2 look for 1 Start X R 1 HAL T 0 Finite State Machine We have this but we cheated using to make recursive definitions Read Write Infinite Tape Mutable Lists Finite State Machine Numbers to keep track of state Processing Way of making decisions if Way to keep going Lecture 40 Computing with Glue and Phot 17 Way to Keep Going f x f xx x f xx z z x z z xx x z z xx z z x z z xx x z z xx x z z xx x z z xx z z x z z xx x z z xx This should give you some belief that we might be able to do it We won t cover the details of why this works in this class x z z xx x z z xx Lecture 40 Computing with Glue and Phot 18 Lambda Calculus is a Universal Computer z z z z z z z z z z z z z z z z z z z z X L R L 2 look for 1 Start X R 1 HAL T 0 Finite State Machine Read Write Infinite Tape Mutable Lists Finite State Machine Numbers to keep track of state Processing Way of making decisions if Way to keep going Lecture 40 Computing with Glue and Phot 19 Equivalent Computers z z z z z z z term variable term term term variable term X L R L 2 look for 1 can simulate Start y M v M y v X R 1 HAL T 0 Finite State Machine …


View Full Document

UVA CS 150 - Lecture 40: Computing with Glue and Photons

Documents in this Course
Objects

Objects

6 pages

Load more
Download Lecture 40: Computing with Glue and Photons
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 40: Computing with Glue and Photons and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 40: Computing with Glue and Photons 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?