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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,103b49cd5a4719fd X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y11g2000yqm.googlegroups.com!not-for-mail From: Phil Thornley Newsgroups: comp.lang.ada Subject: Re: SPARK - Bubble Sort on Rosetta Code Date: Fri, 27 Aug 2010 05:03:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <482d5b45-2efb-4cca-aae6-ed6bd08b4121@y11g2000yqm.googlegroups.com> References: <5688938b-2047-4fef-9ea2-730abb761d07@g17g2000yqe.googlegroups.com> <7462e56f-3cc3-41af-a52d-de47023287cf@q1g2000yqg.googlegroups.com> NNTP-Posting-Host: 80.177.171.182 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1282910620 3395 127.0.0.1 (27 Aug 2010 12:03:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 27 Aug 2010 12:03:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y11g2000yqm.googlegroups.com; posting-host=80.177.171.182; posting-account=Fz1-yAoAAACc1SDCr-Py2qBj8xQ-qC2q User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13777 Date: 2010-08-27T05:03:40-07:00 List-Id: On 27 Aug, 12:03, sjw wrote: > On Aug 27, 8:57 am, Phil Thornley wrote: > > > On 26 Aug, 23:32, Simon Wright wrote:> > > > What would non-SPARK code do to make it fail? > > > Get one of the bounds on the inner loop wrong? =A0Get 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