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,ad06d2d7cb045687 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.222.71 with SMTP id qk7mr9902773pbc.1.1328047725357; Tue, 31 Jan 2012 14:08:45 -0800 (PST) Path: lh20ni246239pbb.0!nntp.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: =?utf-8?B?U2lsbHkgYW5kIHN0dXBpZCBwb3N04oCRY29uZGl0aW9uIG9yIG5vdMKgPw==?= Date: Tue, 31 Jan 2012 23:08:44 +0100 Organization: Ada @ Home Message-ID: References: <12kegkefstjiy.115bw2vmx23ll.dlg@40tude.net> <4f27b5e8$0$6628$9b4e6d93@newsspool2.arcor-online.net> <19jyp0vyqkcop$.6oatj9p6pcp1$.dlg@40tude.net> <4f27dfa5$0$6570$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: ORlngJW8mt48EkB5K/HOIA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.61 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-01-31T23:08:44+01:00 List-Id: Le Tue, 31 Jan 2012 13:33:41 +0100, Georg Bauhaus = a =C3=A9crit: > On 31.01.12 11:22, Dmitry A. Kazakov wrote: >> On Tue, 31 Jan 2012 10:35:35 +0100, Georg Bauhaus wrote: >> >>> On 31.01.12 09:54, Dmitry A. Kazakov wrote: >>>> On Tue, 31 Jan 2012 00:11:43 +0100, Yannick Duch=C3=AAne (Hibou57) = wrote: >>>> >>>>> function Parsed (S : String) return Parsed_Type >>>>> with Post =3D> >>>>> (if S'Length not in Image_Length_Type then >>>>> Parsed'Result.Status =3D Format_Error); >>>>> -- There may be other failure conditions. >>>>> >>>>> >>>>> Is such a post=E2=80=91condition a good or bad practice in your hu= mble or >>>>> authoritative opinion ? >>>> >>>> I would say it would be a bad practice. The reason is that IMO the >>>> postcondition must be complete, it must tell all truth or nothing. = = >>>> Your >>>> prostcondition is a partial truth, it does not describe all cases w= hen >>>> Status is mandated to be Format_Error. >>> >>> One way to express a "hints only" postcondition is >>> >>> with Post =3D> True or -- yes, mathniks, just FTR: >>> (if ... then ... >>> >>> The idea is that the partial truth, in the shape of a >>> formal note, can later lead to an improved program >>> structure. >> >> Apply your idea to the case statement: >> >> case Char is >> when 'A' =3D> Put_Line ("Got A"); >> end case; > > I was only picking up the idea that a case statement's completeness > is decidable and postconditions aren't. Nor need they be. Yet, incompl= ete > information ("lies") can add value to the "about" part of the > annotated thing. Until the formalists succeed in making the > program better ("correct" WRT a set of decidable hypotheses), > that's something. You both got it. I was exactly hesitating between Dmitry's comment and = yours and had both in mind. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity