comp.lang.ada
 help / color / mirror / Atom feed
* SPARK - Bubble Sort on Rosetta Code
@ 2010-08-26  9:18 Phil Thornley
  2010-08-26 21:40 ` Yannick Duchêne (Hibou57)
  2010-08-26 22:32 ` Simon Wright
  0 siblings, 2 replies; 11+ messages in thread
From: Phil Thornley @ 2010-08-26  9:18 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-08-27 12:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox