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,dc717706b9651154 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!v4g2000vba.googlegroups.com!not-for-mail From: Phil Thornley Newsgroups: comp.lang.ada Subject: Re: Workaround for invariant SPARK condition Date: Thu, 25 Jun 2009 00:48:01 -0700 (PDT) Organization: http://groups.google.com Message-ID: <60fb6c3e-3f41-40a6-a445-4d8e12cc49a3@v4g2000vba.googlegroups.com> References: NNTP-Posting-Host: 80.177.171.182 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1245916081 24340 127.0.0.1 (25 Jun 2009 07:48:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 25 Jun 2009 07:48:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v4g2000vba.googlegroups.com; posting-host=80.177.171.182; posting-account=Fz1-yAoAAACc1SDCr-Py2qBj8xQ-qC2q User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6609 Date: 2009-06-25T00:48:01-07:00 List-Id: On 25 June, 00:03, xorque wrote: > Hello. > > I have a piece of code that does this: > > function Check_Support (Request : in Request_t) return Boolean is > begin > =A0 return Request /=3D Unsupported; > end Check_Support; > > I'm using it in some code: > > if Check_Support (Request_Push) then > =A0 ... > end if; > > Request_Push is a compile-time constant with an implementation-defined > value. Given that the value is detected at compile-time, SPARK thinks > the > condition is invariant. > > Is there some way I can tell SPARK that this condition isn't actually > invariant, > even though it appears to be? You could turn it into a variable, but then it would infiltrate into all the annotations, which you probably don't want. This is the sort of problem that the accept annotation is there for: --# accept F, 22, "Value is implementation defined."; if Check_Support (Request_Push) then --# end accept; Phil Thornley