comp.lang.ada
 help / color / mirror / Atom feed
From: crawford@cais2.cais.com (Randolph Crawford)
Subject: Re: What good is halting prob?
Date: 1995/04/19
Date: 1995-04-19T00:00:00+00:00	[thread overview]
Message-ID: <3n285v$9vl@news.cais.com> (raw)
In-Reply-To: cppD7880n.32B@netcom.com

In article <cppD7880n.32B@netcom.com>, Robin Rowe <cpp@netcom.com> wrote:
>In article <3mve9b$gaj@news.cais.com>,
>Randolph Crawford <crawford@cais2.cais.com> wrote:
>>If you can identify a different problem as being basically the same as
>>the halting problem....
>
>The "if" was the point of my question. How do you prove equivalence to 
>the halting problem?

Short of formal substitution or equivalence proofs, you recognize the
same potential for failure, the likelihood that your program will not
terminate as expected due to the introduction of data whose influence 
you cannot anticipate.

>
>>Let's say you wrote a program that you wanted to be "correct".
>>[...] It behaves as it should, it halts, it's deterministic
>>and decidable.  You might conclude from having writen such a program that 
>>with enough effort on the part of the programmer, *every* program could be 
>>written the way this one was, ensuring correctness.  But you'd be mistaken.
>
>Well, if anyone can write one non-trivial program to be "correct" I would 
>then be willing to reconsider if the general case is attainable. Until 
>then, I'm not in much danger of falling into the trap you suggest. If 
>someday machines become more intelligent than we are, correctness may 
>become very difficult to judge. Correctness itself is a very subjective term.

You want a trivial correct program?

main()
{
  if (1) exit( 0);
}

It ain't much, but it's correct.

It's easy to write correct programs.  It's just that some programs (the
UTMs or those programs that contain UTMs) can never be proven correct.  
And correctness is not subjective.  It simply means that the program will
always behave as expected, regardless of the input.  If by correctness, 
you are thinking of "not incorrect", or "acceptably correct", there's
a difference.  You're talking about points on a continuum.  Correct is 
clear at one end; it's perfect.  You can write a program that performs 
properly in most or nearly all cases but fails to terminate under only 
ONE pathological input value, and while that program may be acceptable, 
it's not correct.  It's equally possible for a correct program to do 
nothing useful.  My point is, it's correct as long as it behaves 
entirely predictably (decidably).  (Correctness doesn't have to be a 
reasonable demand on a program.  It's an immutable point of reference, 
like "truth" or "justice".)

> [...]
>Perhaps I'm taking you too literally here. You can, of course, defend 
>yourself from anything you anticipate, but deciding what to if an event 
>occurs may not be feasible. Taking your example of divide by zero, this 
>halts any machine that I am familiar with. Do you feel any concern that it 
>won't halt?

Yes, the program halts.  The choice of halting (by the great masters of CS) 
was a somewhat arbitrary one.  It's just a measure of whether a program is 
correct.  (As it happens, properly functioning turing machines are supposed 
to do several things when they execute, one of which is halt.  Ergo the
choice of "not halting" as a measure of incorrectness.)

Division by zero isn't important except as an exmple of failure.  Likewise 
the inability to halt is a good example of failure.  You can be certain of
anticipating both of these failures *only* if your program is not a Universal
Turing Machine.  If it is a UTM, you cannot be certain that it will behave as
you planned, because you cannot constrain your input data sufficiently. 
That's the purpose behind teaching the halting proglem.

Yes, you can constrain the input of many programs to make them correct.
You can constrain many more programs to make them *sufficiently* correct.
But some programs can never be considered correct in light of the way they 
respond to data (by treating them as programs themselves).  While this last
class of programs may be relatively small, it illustrates the existence of
a potential threat to any program.  Like exponential search and NP-hardness,
it's good to know the limits to how certain of perfection (and safety) you
really can be when writing software.

>
>[...]  No one expects every potential bridge or building design to be 
>decidedly correct. Designs are purposely engineered to be easy to analyze 
>(model). Is this remarkable?

I think the blurring of the difference between software and bridges is
where the confusion lies.  No bridge can be proven correct.  But it's
traditional that the mathematical foundations used in building bridges
*are* considered correct, ie. perfect.  If a civil engineer found that
error was cropping up in his computations *without his/her knowing*
then any bridge or building he builds is at greater risk than he intended.

THAT's the point behind correctness and the halting problem in computer
science-- knowing that you can't assume *too much* when you write code.

-- 
Randy
crawford@mrj.com




  parent reply	other threads:[~1995-04-19  0:00 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-17  0:24 Should internet support software be written in Ada? Bill Brooks
1995-03-17  8:47 ` Anthony Shipman
1995-03-19 22:06 ` David Weller
1995-03-23 15:05   ` Theodore Dennison
1995-03-24 10:26     ` Fred J. McCall
1995-03-27  9:50       ` Robb Nebbe
1995-03-27 19:43         ` State machines and Goto's (was Re: Should internet support software be written in Ada?) Robert I. Eachus
1995-03-27 23:14           ` Arthur Evans Jr
1995-03-29  0:00           ` Dan
1995-04-01  0:00             ` Mike White
1995-04-04  0:00               ` Robert Dewar
1995-04-06  0:00                 ` Theodore Dennison
1995-04-06  0:00                   ` Norman H. Cohen
1995-04-07  0:00                   ` Tucker Taft
1995-04-07  0:00                   ` Robert Dewar
1995-04-07  0:00                 ` Mike White
     [not found]                   ` <3ma7rt$smt@kaiwan009.kaiwan.com>
     [not found]                     ` <dewar.797514490@gnat>
     [not found]                       ` <3meunj$66u@felix.seas.gwu.edu>
1995-04-20  0:00                         ` CS teachers who can't code their way outta a paper bag Richard A. O'Keefe
1995-03-27 14:24       ` Should internet support software be written in Ada? Theodore Dennison
1995-03-28  0:00         ` Robert Dewar
1995-03-28  9:32         ` Fred J. McCall
1995-03-29  0:00           ` Theodore Dennison
1995-03-29  0:00   ` Robert I. Eachus
1995-03-31  0:00     ` Theodore Dennison
1995-04-05  0:00   ` Wes Groleau
1995-04-07  0:00   ` State machines and Goto's (was Re: Should internet support software be written in Ada?) Wes Groleau
1995-04-07  0:00     ` Robert Firth
     [not found]       ` <D6qyv0.6Jv@nntpa.cb.att.com>
1995-04-19  0:00         ` Fergus Henderson
1995-04-19  0:00           ` Fred J. McCall
1995-04-19  0:00             ` George Haddad
1995-04-20  0:00             ` State machines and Goto's (was Re: Sho Brian Hanson
1995-04-20  0:00             ` State machines and Goto's (was Re: Should internet support software be written in Ada?) Bill Winn
1995-04-20  0:00               ` Robert Dewar
1995-04-20  0:00             ` Mark A Biggar
1995-03-22 23:08 ` Should internet support software be written in Ada? Keith Thompson
     [not found] ` <3me1qs$n4a@theopolis.orl.mmc.com>
     [not found]   ` <3mevmu$8an@felix.seas.gwu.edu>
     [not found]     ` <3mh75i$8eu@rational.rational.com>
     [not found]       ` <3mjihr$iqq@felix.seas.gwu.edu>
     [not found]         ` <3mp20f$80t@kaiwan009.kaiwan.com>
1995-04-20  0:00           ` Academic CS Losers? Phillip Fanous
1995-04-21  0:00             ` Bill Winn
     [not found] ` <dewar.798093453@gnat>
1995-04-20  0:00   ` What good is halting prob? Max Hailperin
     [not found] ` <dewar.798207931@gnat>
     [not found]   ` <cppD78ywq.B31@netcom.com>
     [not found]     ` <dewar.798240702@gnat>
1995-04-19  0:00       ` Problems with proofs Brian Harvey
1995-04-19  0:00         ` Robert Dewar
1995-04-20  0:00       ` Robin Rowe
1995-04-20  0:00       ` Robin Rowe
1995-04-20  0:00         ` Steve Tate
1995-04-20  0:00           ` Apology to Steve Robin Rowe
1995-04-20  0:00         ` Problems with proofs Robert Dewar
1995-04-21  0:00           ` Robin Rowe
1995-04-21  0:00             ` Robert Dewar
1995-04-20  0:00         ` Robert Dewar
1995-04-21  0:00         ` Larry Kahn
     [not found]     ` <3n1fsv$lgd@butch.lmsc.lockheed.com>
1995-04-20  0:00       ` Robin Rowe
1995-04-20  0:00         ` Garlington KE
     [not found] ` <3mrv7h$3mq@larry.rice.edu>
     [not found]   ` <3msnu4$6am@kaiwan009.kaiwan.com>
     [not found]     ` <KUBEK.95Apr18213646@insage.gerii.insa-tlse.fr>
     [not found]       ` <cppD792GC.1uI@netcom.com>
1995-04-20  0:00         ` Teaching OO/C++ Philip Machanick
     [not found] ` <cppD75t6F.47M@netcom.com>
     [not found]   ` <EACHUS.95Apr17172831@spectre.mitre.org>
     [not found]     ` <cppD77Ex6.E77@netcom.com>
     [not found]       ` <3mve9b$gaj@news.cais.com>
1995-04-18  0:00         ` What good is halting prob? Jay M Martin
1995-04-19  0:00           ` Steve Tate
1995-04-20  0:00             ` Jay M Martin
1995-04-21  0:00               ` Steve Tate
1995-04-21  0:00             ` Ray Toal
     [not found]         ` <cppD7880n.32B@netcom.com>
1995-04-19  0:00           ` Randolph Crawford [this message]
1995-04-19  0:00             ` Robert Dewar
1995-04-20  0:00             ` Robin Rowe
1995-04-20  0:00               ` Robert Dewar
1995-04-20  0:00                 ` Robin Rowe
1995-04-21  0:00                   ` Brian Hanson
1995-04-21  0:00           ` sxc
     [not found]       ` <dewar.798172270@gnat>
     [not found]         ` <cppD786FM.1u9@netcom.com>
     [not found]           ` <dewar.798207364@gnat>
     [not found]             ` <cppD78xMv.49w@netcom.com>
1995-04-19  0:00               ` Robb Nebbe
     [not found]             ` <3n0ka7$b57@hermes.unt.edu>
     [not found]               ` <dewar.798232482@gnat>
1995-04-19  0:00                 ` Mark A Biggar
1995-04-19  0:00                   ` Steve Tate
1995-04-19  0:00                   ` Robert Dewar
1995-04-19  0:00           ` Mark A Biggar
1995-04-19  0:00             ` Richard Ladd Kirkham
1995-04-19  0:00               ` Robert Dewar
1995-04-20  0:00                 ` Richard Ladd Kirkham
1995-04-20  0:00                   ` Robert Dewar
1995-04-21  0:00               ` Mark A Biggar
1995-04-21  0:00       ` Robert I. Eachus
1995-04-21  0:00         ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox