comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Thornley <phil.jpthornley@gmail.com>
Subject: SPARK - an idea for high integrity data structures
Date: Tue, 20 Jul 2010 05:40:42 -0700 (PDT)
Date: 2010-07-20T05:40:42-07:00	[thread overview]
Message-ID: <9ac8feb3-5b79-41b1-a124-df211039c1bc@c10g2000yqi.googlegroups.com> (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




             reply	other threads:[~2010-07-20 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 12:40 Phil Thornley [this message]
2010-07-20 14:33 ` SPARK - an idea for high integrity data structures 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
replies disabled

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