comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Thornley <phil.jpthornley@googlemail.com>
Subject: Re: Clarification for SPARK postconditions on hidden subprograms.
Date: Fri, 26 Jun 2009 03:32:59 -0700 (PDT)
Date: 2009-06-26T03:32:59-07:00	[thread overview]
Message-ID: <877cb1ea-bf74-4e8b-8bda-83f788f4d5f2@s16g2000vbp.googlegroups.com> (raw)
In-Reply-To: b5695e1d-8385-4820-a710-94d269f0ddb3@r25g2000vbn.googlegroups.com

On 26 June, 10:29, xorque <xorquew...@googlemail.com> wrote:
[...]
> Moving the annotation has, of course, highlighted an apparent error
> on my part:
>
>   82      --# post ((Descriptor  = -1) -> (Error.Get_Error /=
> Error.Error_None)) or
>                                            ^
> ***        Semantic Error    :  3: Incorrect number of actual
> parameters for call
>            of subprogram Get_Error.
>
>   83      --#      ((Descriptor /= -1) -> (Error.Get_Error  =
> Error.Error_None));
>                                            ^
> ***        Semantic Error    :  3: Incorrect number of actual
> parameters for call
>            of subprogram Get_Error.
>
> Does SPARK take issue with parameterless functions? Not unreasonable
> at all if this is the case, as SPARK should probably see them as
> constants.

But this isn't a parameterless function - it must have a global
annotation, something like:
function Error return Error_T;
--# global Stored_Error;

in which case the *proof* function Error has a parameter corresponding
to the global Stored_Error.
(Proof functions are not allowed global access to anything.)

Phil Thornley



      parent reply	other threads:[~2009-06-26 10:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26  1:43 Clarification for SPARK postconditions on hidden subprograms xorque
2009-06-26  7:55 ` Phil Thornley
2009-06-26  9:29   ` xorque
2009-06-26 10:28     ` Rod Chapman
2009-06-26 10:41       ` xorque
2009-06-26 10:32     ` Phil Thornley [this message]
replies disabled

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