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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1d295367cf0b8c48 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news3.google.com!news.glorb.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!newscon06.news.prodigy.com!newscon02.news.prodigy.com!prodigy.net!cyclone.swbell.net!bos-service1.raytheon.com!dfw-service2.ext.ray.com.POSTED!53ab2750!not-for-mail From: Jeffrey Carter User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: loop variant in SPARK ADA References: <1127121942.777976.45330@f14g2000cwb.googlegroups.com> In-Reply-To: <1127121942.777976.45330@f14g2000cwb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 19 Sep 2005 08:40:14 -0700 NNTP-Posting-Host: 147.24.111.90 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.ray.com 1127144416 147.24.111.90 (Mon, 19 Sep 2005 10:40:16 CDT) NNTP-Posting-Date: Mon, 19 Sep 2005 10:40:16 CDT Organization: Raytheon Company Xref: g2news1.google.com comp.lang.ada:4909 Date: 2005-09-19T08:40:14-07:00 List-Id: Constantin Porphyrogenete wrote: > Couldn't find the newsgroup for SPARK. > Thought I'd try this one. SPARK discussions have been welcome here in the past. I hope that won't be changing soon. > Read the book. It seems there is no > way to assert a loop variant to > help prove termination (I am thinking > of the Eiffel loop variant). Presumably you mean a loop invariant? > Is there any reason SPARK ADA doesn't > have this? I don't have the book to hand, but I do have the SPARK Quick Reference 1: "The _/assert annotation/_ can be used to specify conditions that are to be true - of particular use when verifying programs containing loops." There is then an example of a Div procedure to calculate M/N, giving the quotient in Q and the remainder in R. The loop invariant is: --# assert (M = Q * N + R) and (R >= 0); -- Jeffrey Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Grail E-mail: jeffrey_r_carter-nr [commercial-at] raytheon [period | full stop] com