SUNY Geneseo Department of Computer Science


Undecidability

{Date}

CSci 141, Spring 2005
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

SOFI's next Monday (May 2)

Final

Questions?

What if a method in a subclass generates an exception?

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
            boolean genericMightDetector(   P )
                return True

Given a program P, and an input, I, does P run on I ever...

    doOpposite( P )
        if P run on P divides by 0
            print "nyaah nyaah nyaah"
            stop
        else
            print 1 / 0

What if you just run P on I as a detector?

    halts( P, I )
        P(I)
        if P halted
            return true
        else
            return false

Given a program, P, does P ever...

        enigma2
            if infiniteLoop(enigma2)
                then stop
            else
                loop forever

Next Lecture