Lecture 10
Download
1 / 13

Lecture 10 - PowerPoint PPT Presentation


  • 95 Views
  • Uploaded on

Lecture 10. Universal Algorithms moving beyond one problem at a time operating system/general purpose computer. Observation. So far, each program solves one specific problem Divisor Sorting Multiplication Language L. Universal Problem/Program. Universal Problem (nonstandard term) Input

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Lecture 10' - beate


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Lecture 10
Lecture 10

  • Universal Algorithms

    • moving beyond one problem at a time

    • operating system/general purpose computer


Observation
Observation

  • So far, each program solves one specific problem

    • Divisor

    • Sorting

    • Multiplication

    • Language L


Universal problem program
Universal Problem/Program

  • Universal Problem (nonstandard term)

    • Input

      • Program P

      • Input x to program P

    • Task

      • Compute P(x)

  • Univeral Program

    • Program which solves universal problem

      • Universal Turing machine


Example input
Example Input

int main(A[6]) { Input

int i,temp;

for (i=1;i<=3;i++) A[1] = 6

if (A[i] > A[i+3]) { A[2] =4

temp = A[i+3]; A[3] = 2

A[i+3] = A[i]; A[4] = 5

A[i] = temp; A[5] = 3

} A[6] = 1

for (i=1; i<=5; i++)

for (j=i+1;j<=6;j++)

if (A[j-1] > A[j]) {

temp = A[j];

A[j] = A[j-1];

A[j-1] = temp;

}

}


Questions
Questions

  • Which of the following two people is most like a universal program?

    • Brilliant, creative scientist

    • Efficient, obedient soldier

  • How does a universal program work?

  • What is a universal program in real life?


Organization

Program P

Program P’s Memory

Program Counter

Organization

Universal Program’s Memory

Program P

int main(A[6]){

int i,temp;

for (i=1;i<=3;i++)

if (A[i] > A[i+3]) {

temp = A[i+3];

A[i+3] = A[i];

A[i] = temp;

}

for (i=1; i<=5; i++)

for (j=i+1;j<=6;j++)

if (A[j-1] > A[j]) {

temp = A[j];

A[j] = A[j-1];

A[j-1] = temp;

}

}

6

4

2

5

3

1

int A[6],i,temp;

Line 1


Description of universal program
Description of Universal Program

  • Basic Loop

    • Find current line of program P

    • Execute current line of program P

      • Update program P’s memory

    • Update program counter

    • Return to Top of Loop


Past present future
Past, Present, Future

  • Turing came up with the concept of a universal program (Universal Turing machine) in the 1930’s

    • This is well before the invention of the general purpose computer

    • People were still thinking of computing devices as special-purpose devices (calculators, etc.)

    • Turing helped move people beyond this narrow perspective

  • Turing/Von Neumann perspective

    • Computers are general purpose/universal algorithms

      • Focused on computation

      • Stand-alone

  • Today, we are moving beyond this view

    • Computation, communication, cyberspace

    • However, results in Turing perspective still relevant


Halting problem revisited
Halting Problem Revisited

  • Halting Problem is half-solvable

    • Modified Universal Program (MUP) half-solves H

      Run P on x

      Output yes

      • This step only executed if first step halts

  • Behavior

    • MUP halts and accepts all yes instances of H

    • MUP loops on all no instances of H

      • Stuck in “Run P on x” step


Debuggers
Debuggers

  • How do debugger’s like gdb or ddd work?

    • They basically operate like a universal program

    • Key properties of debugger’s to aid in debugging

      • Breakpoints

      • Display memory commands


Re and rec
RE and REC

  • We now have a problem that is half-solvable but not solvable

  • What do we now know about the complement of the Halting Problem?

    • It is not even half-solvable

  • This proves RE is not closed under the set complement operation

    • H is counterexample


Re and rec1

H

REC

Hc

RE and REC

All Languages

RE


Summary
Summary

  • Universal Programs

    • 1930’s, Turing

    • Introduces general purpose computing concept

    • Not a super intelligent program, merely a precise follower of instructions

  • Halting Problem half-solvable but not solvable

    • RE not closed under set complement


ad