[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Greetings
> X-Authentication-Warning: fast.cs.utah.edu: majordom set sender to owner-plt-scheme@flux.cs.utah.edu using -f
> Cc: <plt-scheme@fast.cs.utah.edu>
> From: Chris Uzdavinis <chris@atdesk.com>
> Organization: Automated Trading Desk, Inc.
> Date: 08 Oct 2001 12:05:39 -0400
> User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
> Content-Type: text/plain; charset=us-ascii
> Sender: owner-plt-scheme@fast.cs.utah.edu
> Precedence: bulk
>
> "Paul Steckler" <steck@ccs.neu.edu> writes:
>
> > > If anyone could explain what I've done wrong to warrent this warning,
> > > I'd be very thankful.
> >
> > The problem is that `cur' might be an empty list, in which case
> > `car' would fail; the inferred type of `cur' is (listof sym), which
> > includes the empty list. If your loop had a test for null?,
> > MrSpidey might be able to do better.
>
>
> Isn't that just a theoretical problem? As far as I can tell
> there is no possible way for an empty list to ever be bound to cur.
>
> I was under the impression that Mr. Spidy would report on problems
> that it saw possible paths that could actually happen.
>
Nope. MrSpidey sets up naive set-inclusions for the program and propagates
them thru the program. If there is a possible problem, it will indicate
this with red. It is then up to the programmer to decide (and document)
whether this is a weakness in the theorem prover or in the program.
> It's been pointed out that the problem is with my "length"
> counter, which was an attempt at optimization to reduce the number of
> recursions when it could calculate the fact that there isn't enough
> "available" items to possibly create another answer.
>
> (I wasn't using it as an index, but rather a way of knowing that if we
> want 'n' items from a list of length m, that we don't keep searching
> in list m if it doesn't have enough items in the first place. I
> didn't want to just stop on an empty list, but also on a non-empty
> list that was too small.)
I understand that you used it as a length rather than an index. See my
slogan. Can you give an example where the list is too short?
>
> Thanks to everyone for their feedback. I'm going to investigate some
> of the suggested alternate implementations.
>
> --
> Chris
>