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-7-bit Received: by 10.204.155.75 with SMTP id r11mr2721365bkw.7.1328104206192; Wed, 01 Feb 2012 05:50:06 -0800 (PST) Path: cj8ni163684bkb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Silly and stupid =?UTF-8?B?cG9zdOKAkWNvbmRpdGlvbiBvciBub3TCoA==?= =?UTF-8?B?Pw==?= Date: Wed, 1 Feb 2012 14:49:25 +0100 Organization: cbb software GmbH 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> <12pod8zxdo56v.16pnewlc853au$.dlg@40tude.net> <4f280a00$0$6583$9b4e6d93@newsspool3.arcor-online.net> <4f284488$0$6634$9b4e6d93@newsspool2.arcor-online.net> <1wn5azarpihb1.13g4tvu7fddve.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="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-02-01T14:49:25+01:00 List-Id: On Wed, 1 Feb 2012 11:37:31 +0100, stefan-lucks@see-the.signature wrote: > On Wed, 1 Feb 2012, Dmitry A. Kazakov wrote: > >> But that seems not bad enough. To make the disaster complete, it should >> become undefined as well. Right? > > This doesn't need to be a disaster. > > 1. For the purpose of proving program correctness, Proving incorrectness, you mean, since the thing is partial. > If that is all what we need F for, why should we bother with any > postcondition or even X? What about this: function Sine (X : Float) return Float is begin if X = 0.0 then return 0.0; end if; end Sine; > 2. Sometimes, it may hard to prove the entire contract. So we will try to > prove the "important" requirements in the contract, and try to convince > ourselves by conventional means (testing, code review, ...) that other > requirements are also satisfied. [...] No. In that case, and this was my point, the thing must be designed in a way which clearly distinguished the provable/specified/defined part from the rest. I proposed to introduce Length_Error to indicate a contracted error case. >>> function Parsed (S : String) return Parsed_Type >>> with Post => >>> (if S'Length not in Image_Length_Type then >>> Parsed'Result.Status = Format_Error); >>> -- There may be other failure conditions. > > What is special about that specific failure condition that singles it out > from all other failure conditions? For the reader it is unclear the statement the postcondition makes. Does it define the meaning of Format_Error? This does not look like a contract (provable or not, that is no matter). The most close thing which comes into mind is a use case. But use ceases do not belong to the code. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de