From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10db24,77f71d0bde4c5bb4 X-Google-Attributes: gid10db24,public X-Google-Thread: 103376,86fd56abf3579c34 X-Google-Attributes: gid103376,public From: RTOAL@lmumail.lmu.edu (Ray Toal) Subject: Re: What good is halting prob? Date: 1995/04/21 Message-ID: #1/1 X-Deja-AN: 101370102 distribution: world references: <3kaksj$iur@isnews.calpoly.edu> <3mve9b$gaj@news.cais.com> <3n27g6$4qr@kaiwan009.kaiwan.com> <3n3b82$ild@hermes.unt.edu> organization: Loyola Marymount University newsgroups: comp.lang.ada,comp.edu Date: 1995-04-21T00:00:00+00:00 List-Id: In article <3n3b82$ild@hermes.unt.edu> srt@zaphod.csci.unt.edu (Steve Tate) writes: >I have seen concepts from the theory of computing (both computability >and complexity) presented in many different ways, including a >presentation using register machines made by a famous >mathematician/logician/recursion theorist. Here's one that just uses Ada 95 (sorry if this is common knowledge): Given: type Program is access procedure; We want to write: function Halts (P: Program) return Boolean; But we cannot because we can write procedure Nasty is begin if Halts (Nasty'Access) then loop null; end loop; end if; end Nasty; which halts if and only if it doesn't. I've found this an effective way to present the halting problem to students who have not yet seen Turing Machines. (Of course, before Ada 95, I had to show them in C++ due to the lack of subprograms as parameters in Ada 83.) Ray Toal