comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Thornley <phil.jpthornley@gmail.com>
Subject: SPARK - Bubble Sort on Rosetta Code
Date: Thu, 26 Aug 2010 02:18:20 -0700 (PDT)
Date: 2010-08-26T02:18:20-07:00	[thread overview]
Message-ID: <5688938b-2047-4fef-9ea2-730abb761d07@g17g2000yqe.googlegroups.com> (raw)

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

I've used the Ada version on there as the starting point, with Integer
for the stored element and for the array index,

There are three versions:

The first is simply shown to be type-safe.

The second, with identical Ada code, proves that the output array is
sorted. This requires just two simple proof rules as the inner loop
scans the complete array for every pass of the outer loop.

The third version scans a reducing portion of the array in the inner
loop and this makes the proof quite a bit more complex. My main
concern is that the number of proof rules that this requires could
look rather frightening to a casual browser and do more harm than
good.

Cheers,

Phil



             reply	other threads:[~2010-08-26  9:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26  9:18 Phil Thornley [this message]
2010-08-26 21:40 ` SPARK - Bubble Sort on Rosetta Code 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
replies disabled

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