POV-Ray : Newsgroups : povray.pov4.discussion.general : I want to be rid of my stupid mistakes : Re: I want to be rid of my stupid mistakes Server Time
19 May 2024 07:07:06 EDT (-0400)
  Re: I want to be rid of my stupid mistakes  
From: clipka
Date: 22 Jul 2009 10:30:01
Message: <web.4a6721ca97aca27169042aac0@news.povray.org>
"scott" <sco### [at] scottcom> wrote:
> I'm not saying it's possible to detect whether any program will stop or not.
> I'm saying that in *some* cases you can relatively easily detect that it
> won't stop without changing the functionality.

I'm definitely repeating myself here: Those easy cases would come packaged with
too many not-so-easy special cases.

Sure you can detect a simple

  #while (i < N)
    //#declare i=...
  #end

as being an infinite loop, but that's an absolutely trivial case; as soon as you
go from there to

  #while (i < N)
    ...
    //#declare i=...
    ...
  #end

then if you don't find a "#declare i=...", you *must* examine the "..."
thoroughly before you can conclude that the user really forgot it.

Of course, if you *do* find a "#declare i=..." in there, you can tell for sure
the user did *not* forget it; but that doesn't get us any further.

The bottom line is that a potentially-infite-loop detector would be a quite
complex piece of code, even if it were just to catch some standard cases. There
would be much easier and more useful remedies for the forgotten-increment
ailment.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.