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!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.71.MISMATCH!xlned.com!feeder3.xlned.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.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: Thu, 27 May 2010 13:32:15 +0200 Organization: Ada At Home Message-ID: References: <0466e131-cc80-4db4-b080-eec9aefcb1c7@z17g2000vbd.googlegroups.com> NNTP-Posting-Host: VsdMw8HJ6uo7b6guDb/gnA.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:12072 Date: 2010-05-27T13:32:15+02:00 List-Id: Le Thu, 27 May 2010 12:55:04 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > And Simplifier fails to prove Check #3 ; an excerpt of the *.SIV file = = > shows why (conclusion associated to Check #3): > > C1: bit__and(v, 1) =3D 0 or bit__and(v, 1) =3D 1 . Ok, found. I was not correct with the way to require the type to be = integer as done in my_set(1): (X=3D0) or (X=3D1) may_be_deduced_from [ integer(X), X>=3D= 0, X<=3D1 = ]. It has to be my_set(1): (X=3D0) or (X=3D1) may_be_deduced_from [ = goal(checktype(X,integer)), X>=3D0, X<=3D1 ]. I've check that my_set(1): (X=3D0) or (X=3D1) may_be_deduced_from [ goal(integer(X))= , X>=3D0, = X<=3D1 ]. does not work, which lead to another question : what is the difference = between the two predicates =E2=80=9Cinteger(X)=E2=80=9D and =E2=80=9Cche= cktype(X,integer)=E2=80=9D ? The = documentation is not clear to me about it. About =E2=80=9Cchecktype(EXPR= ESSION, = TYPE_IDENTIFIER)=E2=80=9D, it says =E2=80=9CThis predicate may be used t= o check that an = expression is of an appropriate type=E2=80=9D and about =E2=80=9Cinteger= (EXPRESSION)=E2=80=9D is = says This built-in Prolog predicate succeeds if and only if its argument= = is instantiated to an integer. So what's the difference between = =E2=80=9Cgoal(integer(X))=E2=80=9D and =E2=80=9Cgoal(checktype(X,integer= ))=E2=80=9D. Does the latter = refers to root type as defined in source and the other to something else= ? = (so what?) Another strange thing is that the file NUMINEQS.RUL does not contains an= y = predicate stating arguments have to be integers and there is just a = comment in heading, nothing in rules about it. -- = 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.