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,ec6f74e58e86b38b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Lost in translation (with SPARK user rules) Date: Sun, 30 May 2010 01:03:31 +0200 Organization: Ada At Home Message-ID: References: NNTP-Posting-Host: qUfwAWuer84MZJ3PpksnTQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; 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.53 (Win32) Xref: g2news2.google.com comp.lang.ada:12150 Date: 2010-05-30T01:03:31+02:00 List-Id: Le Wed, 26 May 2010 12:09:17 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Lost in translation... do you know the movie ? > No, I'm joking, this is not about this 2002 movie, that's about SPARK,= = > and exactly, > about translating some expressions in the rules language. > [...] In this area, the Simplifier sometimes shows slight capacities to be = boring. Let a Check clause be =E2=80=9C--# check ((2 ** Count) < (2 ** 8)) -> (C= ount < 8);=E2=80=9D Let a user rule be =E2=80=9Cmy_rule: ((X ** Y) < (X ** Z)) -> (Y < Z) = may_be_deduced_from [some-obvious-conditions].=E2=80=9D There should be an exact match, isn't it ? Well, I guess you guess: it fails to prove the Check clause. Now, if you= = would like to know why, here is: it replaces this by =E2=80=9C2 ** count= < 256 -> = count < 8=E2=80=9D, ... it turns =E2=80=9C(2 ** 8)=E2=80=9D into =E2=80=9C= 256=E2=80=9D, so that it can't see any = more an exact match with the user rule I've check in the *.SLG file, this is indeed due to simplification, this= = is not due to an hypothetical related error. -- = 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.