comp.lang.ada
 help / color / mirror / Atom feed
From: xorquewasp@googlemail.com
Subject: Re: Representing errno in SPARK
Date: Tue, 9 Jun 2009 09:11:28 -0700 (PDT)
Date: 2009-06-09T09:11:28-07:00	[thread overview]
Message-ID: <f5ea2a0d-3a2c-4ffa-89ba-f1619d671bb8@h28g2000yqd.googlegroups.com> (raw)
In-Reply-To: 51812f56-6c0a-407a-9f53-98c9b15f957c@p4g2000vba.googlegroups.com

Phil Thornley wrote:
> What you are trying to do (by having other SPARK code in the body) is
> mixing code that is inside and outside the 'SPARK boundary' in a
> single package.

I'm not entirely sure that's the case. The code in the body just maps
errno values to enumeration values. I'd consider this code to be on
the boundary at most (as opposed to any of it being "outside").

> One possibility is to move the Errno abstraction and the two imported
> operations to another package internal to POSIX (but this means having
> an implementation for the POSIX versions of these subprograms). So:
>
> 1 - Remove the Import pragmas from POSIX spec.
> 2 - Create an internal package (eg POSIX.Internals) in the POSIX body
> that has the Errno abstraction and the imported subprograms.
> 3 - In the refinement annotation on the POSIX body put "--# own Errno
> is Internals.Errno;".
> 4 - Call through to these imported subprograms in the implementation
> of the subprograms that you now have to provide.

Certainly a possibility.

> (A second possibility is simply to create an Errno in the package body
> with a comment that it isn't actually used by the code ...)

I did consider this but I wondered if this would cause issue with
SPARK's
flow analysis (as I'm only pretending to read/write a variable).



  reply	other threads:[~2009-06-09 16:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 14:06 Representing errno in SPARK xorquewasp
2009-06-09 14:32 ` roderick.chapman
2009-06-09 15:02   ` xorquewasp
2009-06-09 16:03     ` Phil Thornley
2009-06-09 16:11       ` xorquewasp [this message]
2009-06-09 17:26         ` 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