comp.lang.ada
 help / color / mirror / Atom feed
* SPARK - an idea for high integrity data structures
@ 2010-07-20 12:40 Phil Thornley
  2010-07-20 14:33 ` Matteo Bordin
  2010-07-20 19:07 ` Peter C. Chapin
  0 siblings, 2 replies; 8+ messages in thread
From: Phil Thornley @ 2010-07-20 12:40 UTC (permalink / raw)


I have had a hobby project for a while to create SPARK versions of
data structures, supported by partial proofs of correctness.

However, if the proofs are tackled in the most obvious way then the
effort required to show that the relevant data structure invariant is
maintained by each operation grows out of all proportion to the size
of the code being proved, and it would be easier to validate the code
directly than to validate all the proof artefacts (annotations and
rules) that are generated for the proof.

So I have recently tried an alternative approach that shows some
potential for completing the proofs without requiring disproportionate
effort.

The idea is to determine, for each path through an operation that
exports a value of the data structure, the relationship between the
imported value and exported value and to create a single proof rule
that encapsulates that transformation.  If the rule proves the
postcondition VC generated for the path then the code implements the
transformation.

This is clearly a less rigorous approach than proving that the code
maintains all the individual conditions within the invariant, but it
is much more practicable.

As an example of this approach I have completed the proofs for an
ordered list of integers and put this up on http://www.sparksure.com
(I have included a stack and a queue as well, but neither of these
require data structure invariants).

I am very interested in all comments that anybody might have about
this idea - either here on cla or via the email address on the
website.

Phil Thornley




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

end of thread, other threads:[~2010-07-22 10:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-20 12:40 SPARK - an idea for high integrity data structures Phil Thornley
2010-07-20 14:33 ` Matteo Bordin
2010-07-20 19:02   ` Phil Thornley
2010-07-20 19:07 ` Peter C. Chapin
2010-07-20 19:18   ` Simon Wright
2010-07-21 12:40     ` Phil Thornley
2010-07-21 13:23       ` Peter C. Chapin
2010-07-22 10:14         ` Matteo Bordin

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