comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: SPARK - Bubble Sort on Rosetta Code
Date: Thu, 26 Aug 2010 23:32:08 +0100
Date: 2010-08-26T23:32:08+01:00	[thread overview]
Message-ID: <m2r5hlatuf.fsf@pushface.org> (raw)
In-Reply-To: 5688938b-2047-4fef-9ea2-730abb761d07@g17g2000yqe.googlegroups.com

Phil Thornley <phil.jpthornley@gmail.com> writes:

> I've put some SPARK code for the Bubble Sort task on Rosetta Code and
> I would welcome opinions on whether they make a good showcase for
> SPARK

It took me a while to find them -- at
http://rosettacode.org/wiki/Sorting_algorithms/Bubble_sort#SPARK.

> The first is simply shown to be type-safe.

Is this the same as "guaranteed free of any run-time error"?

What would non-SPARK code do to make it fail?

> The second, with identical Ada code, proves that the output array is
> sorted.

Are zero-length arrays forbidden in SPARK? I ask because of 

      --# check A'Last <= A'First -> A'Last = A'First;

(what's that -> ? I understood that the syntax was
   'check <boolean expression>').



  parent reply	other threads:[~2010-08-26 22:32 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 [this message]
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
replies disabled

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