comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Thornley <phil.jpthornley@gmail.com>
Subject: Re: SPARK - Bubble Sort on Rosetta Code
Date: Fri, 27 Aug 2010 05:03:40 -0700 (PDT)
Date: 2010-08-27T05:03:40-07:00	[thread overview]
Message-ID: <482d5b45-2efb-4cca-aae6-ed6bd08b4121@y11g2000yqm.googlegroups.com> (raw)
In-Reply-To: 7462e56f-3cc3-41af-a52d-de47023287cf@q1g2000yqg.googlegroups.com

On 27 Aug, 12:03, sjw <simon.j.wri...@mac.com> wrote:
> On Aug 27, 8:57 am, Phil Thornley <phil.jpthorn...@gmail.com> wrote:
>
> > On 26 Aug, 23:32, Simon Wright <si...@pushface.org> wrote:>
> > > What would non-SPARK code do to make it fail?
>
> > Get one of the bounds on the inner loop wrong?  Get the termination
> > condition wrong for the outer loop and increment the pointer past the
> > end?
>
> Sorry for lack of clarity. The page says "guaranteed free of any run-
> time error when called from any other SPARK code", and I meant, how
> might *this* code fail when called from other *non-SPARK* code? (T

Ah I see what you mean.  It's really just a catch-all statement
because the array that it imports isn't guaranteed to conform to SPARK
restrictions if called from Ada code - it could be a null array.  The
Examiner unconditionally assumes that 'First of the array index type
cannot be greater than 'Last so the proofs would be unreliable in this
case.

I'm fairly sure (;-) that there won't be any run-time error if called
with a null-array, but the static analysis doesn't prove this.

Cheers,

Phil



      reply	other threads:[~2010-08-27 12:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26  9:18 SPARK - Bubble Sort on Rosetta Code Phil Thornley
2010-08-26 21:40 ` Yannick Duchêne (Hibou57)
2010-08-27  4:28   ` Yannick Duchêne (Hibou57)
2010-08-27  7:35   ` Phil Thornley
2010-08-27  8:04     ` Yannick Duchêne (Hibou57)
2010-08-26 22:32 ` Simon Wright
2010-08-27  0:38   ` Yannick Duchêne (Hibou57)
2010-08-27  7:57   ` Phil Thornley
2010-08-27  9:02     ` Phil Thornley
2010-08-27 11:03     ` sjw
2010-08-27 12:03       ` Phil Thornley [this message]
replies disabled

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