Teach Time Encyclopedia - Learn About Our World
Home Page
Teach Time
Featured Topics

United States
by state

CITYology

Academic Disciplines

Historical Timelines

Themed Timelines

Calendars

Reference Tables

Biographies

How-tos



Thursday, December 04, 2008

Kleene's recursion theorem

Kleene's recursion theorem is a result in computability theory first proved by Stephen Kleene; it allows to construct programs, Turing machines and recursive functions that refer back to their own description.

The theorem can be formulated for any of the equivalent models of computation listed in the computability theory article. Here we will use Pascal programs.

If p is a string that describes a Pascal program which reads a single input string and produces a single output string, then we will denote the corresponding partial function from input strings to output strings by fp. (This is a partial function because for some input strings the program described by p may run into an infinite loop and never produce an output.)

The statement of the theorem is as follows: If Q is a Pascal program which takes two input strings x and y and produces a single output string Q(x,y) (which again may be undefined if Q runs into an infinite loop), then there always exists a string p describing some Pascal program such that for all input strings y:

Q(p,y) = fp(y).
This latter equality is to be read as an equality of partial functions: Q(p,y) is defined if and only if fp(y) is defined, and in this case the two values are the same.

As an application, we can show that there must exist a Pascal program which takes a single input, ignores that input and prints itself as output: Define Q(x,y) = x, then the theorem yields a Pascal program p such that for all y: fp(y) = Q(p,y) = p. It is an amusing exercise to actually write such a program p.



Internet Hotel Solutions

Site Sponsors
AC Units
Baltimore Harbor
Boot Camp Grads
Bra Size
Burkittsville
College Hotels
Digital Harbor
Free Cell Phones
Golden Hare Travel
Golf Vacations
Golf Courses
Gourmet
Hair Styles
Hippodrome
iWoman
Lesson Plans
Maryland Hotels
MD Genealogy
Minor League Stuff
Motel Site
Ocean City
OC Real Estate
Old Agers
Office Supplies
Orlando
Pet Friendly Hotel
Room Prices
Savannah, GA
Ski Vacations
South Baltimore
Student Teaching
Travel Sources
University Hotels
Visit Military Bases
Washington, DC

Brought to you by NoChildLeftBehind.com and the Beaches and Towns Network, LLC.