Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!uokmax!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.misc Subject: Re: Array references cannot be made optimal Message-ID: <4279@goanna.cs.rmit.oz.au> Date: 15 Nov 90 06:09:54 GMT References: <3975:Nov1323:25:4390@kramden.acf.nyu.edu> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 21 In article <3975:Nov1323:25:4390@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > Here are two articles about the practical solution to the halting > problem. The technique referred to is commonly known as "Tortoise and Hare". It's a very handy technique for programs that wander around graphs and other finite data structures. Most of the non-terminating loops my programs go into involve constructing ever larger data structures, so tend to be detected by the storage allocator... Eiffel is one of the few languages around which provides for termination tests: when you write a loop you can provide an expression whose value must decrease on each iteration, while remaining non-negative. If it goes negative or fails to decrease, the informal proof of termination you presumably had in mind when you wrote the loop is flawed. An old idea and a simple one. It's _very_ nice to see it actually provided as a debugging tool that's easy to use. -- The problem about real life is that moving one's knight to QB3 may always be replied to with a lob across the net. --Alasdair Macintyre.