comp.lang.ada
 help / color / mirror / Atom feed
* Clarification for SPARK postconditions on hidden subprograms.
@ 2009-06-26  1:43 xorque
  2009-06-26  7:55 ` Phil Thornley
  0 siblings, 1 reply; 6+ messages in thread
From: xorque @ 2009-06-26  1:43 UTC (permalink / raw)


Hello.

I'm trying to work out what should be happening regarding the
postcondition
on a function with a hidden body:

  function C_Open_Boundary
    (File_Name : in String;
     Flags     : in Open_Flag_Integer_t;
     Mode      : in Permissions.Mode_Integer_t) return Descriptor_t
  is
    --# hide C_Open_Boundary
    --# return D => (D  = -1 -> Error.Get_Error /= Error.Error_None)
or
    --#             (D /= -1 -> Error.Get_Error  = Error.Error_None);
    ...
  end C_Open_Boundary;

Is a postcondition on a hidden subprogram always assumed to have
been satisfied?

I ask because a subprogram that calls C_Open_Boundary and then
checks the return value against -1 can't seem to work out that
Error.Get_Error won't be equal to Error.Error_None when the value
is equal to -1.

Is it an error in my postcondition?

I will post more of the implementation if necessary, I just don't want
to spam the list with a 100 lines of VCGs...



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

end of thread, other threads:[~2009-06-26 10:41 UTC | newest]

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