SUNY Geneseo Department of Computer Science


The Halting Problem

{Date}

CSci 141, Spring 2005
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

SOFI's next Monday (May 2)

Final

Questions?

Star in lab, and analyzing "for" loop?

Sections 17.1 and 17.2

Introduction: halting problem

Quasi-Java for "terminate"

Impossible problem: Barber of Seville

Proving the halting problem is unsolvable

Maybe the problem lies in "enigma", is it really codable? Or maybe "enigma" is illegal (violates precondition) input to "terminate"? Somehow it seems that if people can recognize when an algorithm does or doesn't halt, then an algorithm should be able to also.

Moral: limitations to CS - some things it just can't do

The Halting Problem Concretely

A Java Driver and Halting Detector (in stub form), with a "paradox" method that cannot be correctly analyzed for halting.

Proving Problems Undecidable

Given a program, P, with no input, does P infect a computer that runs it with a virus?

    paradoxVirus
        if paradoxVirus infects computer
            stop
        else
            infect computer w/ something

If a correct virus detector exists, then paradoxVirus forces it to be wrong -- contradiction between the detector being correct, and it producing a wrong answer on some input.

Mini-Assignment: You all know that "anti-virus" software exists -- how does it get around this undecidability result?


Next Lecture