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: 103376,b36bbdc1595d0665 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: Re: SPARK code samples Date: Thu, 12 Aug 2010 15:41:00 +0200 Organization: Ada At Home Message-ID: References: <1iq8kg021bo4v$.s51i2enx3fzo.dlg@40tude.net> <1lvyv3r0md69x.1cz8ylwiupqva$.dlg@40tude.net> NNTP-Posting-Host: 1WD2E88ze6L7DouMlRHgzg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.60 (Win32) Xref: g2news1.google.com comp.lang.ada:13177 Date: 2010-08-12T15:41:00+02:00 List-Id: Le Thu, 12 Aug 2010 09:29:22 +0200, Maciej Sobczak = a =E9crit: > No. AARM 3.5.4/21 defines the minimum range for Integer, it is > -2**15+1..2**15-1. I was aware of that for Ada, while not sure for SPARK, as this depends o= n = a machine description file. Will suppose it in the future. > I also think that if the program requirements say that the input will > be in some range, you can assume this is true without asserting it. > The point is that such requirements are verifiable outside of the > program, for example by the design of subsystem (hardware data source,= > perhaps?) that feeds input to your component. OK, I see. That is a clever point (I had never operate in a staff, so I = = could not know that). > The environment is not > necessarily an English-speaking human sitting in front of the screen -= > especially in the case of SPARK programs. ;-) Assumed that if there is a SPARK_IO, this ends into something which is n= ot = dropped (either screen, file, single line text display, any) Good point anyway. -- = There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.