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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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,ASCII Received: by 10.68.74.201 with SMTP id w9mr4833843pbv.0.1328275162367; Fri, 03 Feb 2012 05:19:22 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.131.2 Path: lh20ni255885pbb.0!nntp.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!88.191.131.2.MISMATCH!news.chainon-marquant.org!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Silly and stupid post-condition or not ? Date: Fri, 3 Feb 2012 14:18:40 +0100 Organization: cbb software GmbH Message-ID: References: <82wr86fzos.fsf@stephe-leake.org> <5af407fc-2868-44ca-84d2-c51a2a64104d@o4g2000pbc.googlegroups.com> <82k445fu9n.fsf@stephe-leake.org> <1q29nqwr7e7u4.1qrz4gd6twxim.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-02-03T14:18:40+01:00 List-Id: On Fri, 03 Feb 2012 12:40:36 +0100, Yannick Duch�ne (Hibou57) wrote: > Le Fri, 03 Feb 2012 12:09:10 +0100, Dmitry A. Kazakov > a �crit: > >> On Fri, 03 Feb 2012 10:48:34 +0100, Yannick Duch�ne (Hibou57) wrote: >> >>> Le Fri, 03 Feb 2012 10:12:25 +0100, Dmitry A. Kazakov >>> a �crit: >>>> In the OP example, >>>> Format_Error of unspecified semantics is to be used heavily. >>> >>> Format_Error as a specified semantic: Error. Which turns to disallow any >>> access to any parsed Instance. >> >> If that is *the semantics* then the prostcondition is >> >> Result.Status = Format_Error => Result.Instance raise Constraint_Error > > Format_Error is a possible value of a discriminant. The postcondition > applies to the Image function. I see no way to drift from the latter to > the former. I understood you asked me what is the meaning of the value > Format_Error, not what is the meaning of the postcondition. Supposed to specify the semantics of the operation in terms of the parameter and result values. Not in Ada 2012, of course... >> which is of Ada's variant record type. Are you designing compiler tests? > Excuse me, I don't understand. You are confusing the semantics of the language types with the problem domain. In the problem domain Format_Error should tell something about the image object, rather than to disallow anything. Your postcondition is not to deliver that message. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de