From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c91e482ae6ca8d4b,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v2g2000vbb.googlegroups.com!not-for-mail From: xorque Newsgroups: comp.lang.ada Subject: Clarification for SPARK postconditions on hidden subprograms. Date: Thu, 25 Jun 2009 18:43:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <898abcf6-7315-4015-9d73-d9365a870294@v2g2000vbb.googlegroups.com> NNTP-Posting-Host: 62.249.247.223 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1245980585 24423 127.0.0.1 (26 Jun 2009 01:43:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 26 Jun 2009 01:43:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v2g2000vbb.googlegroups.com; posting-host=62.249.247.223; posting-account=D9GNUgoAAAAmg7CCIh9FhKHNAJmHypsp User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030814 Iceweasel/3.0.9 (Debian-3.0.9-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6624 Date: 2009-06-25T18:43:05-07:00 List-Id: 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...