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,d4e6b104ff087788 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!fu-berlin.de!news.swapon.de!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: SPARK : surprising failure with implication Date: Wed, 02 Jun 2010 06:34:54 +0200 Organization: Ada At Home Message-ID: References: NNTP-Posting-Host: FWfoAwrKC5rz12vcTu3tlw.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:12187 Date: 2010-06-02T06:34:54+02:00 List-Id: Le Tue, 01 Jun 2010 20:51:04 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Hi all, > > In an Ada/SPARK source, I had something like this: > > --# check (Source =3D 1) -> ((Source mod 2) =3D 1); -- (1) > --# check (Source mod 2) /=3D 1; -- (2) > --# check Source /=3D 1; -- (3) > > 1) Was proved by the simplifier (note that I needed a user rule for = > that). > 2) Is a valid hypothesis ; an already proved conclusion (in some prior= = > check clauses) > 3) Failed to be proved, while I expected this to be proved from (1) an= d = > (2). > > [...] Although late, I'm back to this topic. I added this user rule: my_logic(1): not B -> not A may_be_deduced_from [ (A -> B) ]. While this was looking so much obvious, I though the Simplifier already = = knew it and this would probably change nothing. But this did change = something! Now the above sequence of hypothesis->conclusion is proved. Did I made something wrong somewhere ? Did I brake something somewhere ?= = Why is not this fundamental rule embedded in the Simplifier ? I was so much surprised, that I checked it (yes, what looks obvious is = sometimes good to check). Can't say anything else that =E2=80=9Cyes, thi= s is true=E2=80=9D. (A) (B) (A->B) F F T F T T T F F T T T (not B) (not A) (not B -> not A) T T T F T T T F F F F T (A -> B) (not B -> not A) ((A -> B) -> (not B -> not A)) T T T T T T F F T T T T This is indeed tautology. OK, that is solved, but I'm still somewhat frightened by what I don't = understand in this experience : why did I need to add a user rule for th= at = ? What was wrong ? -- = 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.