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: a07f3367d7,b78c363353551702 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.126.4 with SMTP id gu4mr1839165bkc.8.1341581838407; Fri, 06 Jul 2012 06:37:18 -0700 (PDT) Path: y28ni11098bky.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: about the new Ada 2012 pre/post conditions Date: Fri, 6 Jul 2012 15:37:21 +0200 Organization: cbb software GmbH Message-ID: <7xnkuta2d94n$.1815f9iev4s7r$.dlg@40tude.net> References: <4fe83aaa$0$6624$9b4e6d93@newsspool2.arcor-online.net> <1pkfv0tiod3rn$.onx6dmaa3if9$.dlg@40tude.net> <1i1mp8xs3vtl2.1oc4m66qtfgzq.dlg@40tude.net> <33crfw5vkxoh$.kz5mq75s36ee.dlg@40tude.net> <43e4637c-3337-4d99-be45-20e054e5a203@googlegroups.com> <6ua1uo9zmkjn$.1tmqyzmetx71u$.dlg@40tude.net> <4ff6969e$0$9514$9b4e6d93@newsspool1.arcor-online.net> <1xkiqefb6watw.10fvt344m3c4g$.dlg@40tude.net> <4ff6a20a$0$9525$9b4e6d93@newsspool1.arcor-online.net> <1l7pg7ihwb9vn$.kq6k3ypjwl07.dlg@40tude.net> <4ff6d51a$0$9514$9b4e6d93@newsspool1.arcor-online.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-07-06T15:37:21+02:00 List-Id: On Fri, 06 Jul 2012 14:07:52 +0200, Georg Bauhaus wrote: > On 06.07.12 11:01, Dmitry A. Kazakov wrote: >> On Fri, 06 Jul 2012 10:30:01 +0200, Georg Bauhaus wrote: >> >>> On 06.07.12 10:05, Dmitry A. Kazakov wrote: >>>> On Fri, 06 Jul 2012 09:41:18 +0200, Georg Bauhaus wrote: >>>> >>>>> On 05.07.12 21:55, Dmitry A. Kazakov wrote: >>>>>> On Thu, 5 Jul 2012 12:11:57 -0700 (PDT), Adam Beneschan wrote: >>>>>> >>>>>>> On Thursday, July 5, 2012 12:48:30 AM UTC-7, Dmitry A. Kazakov wrote: >>>>>>> >>>>>>>> Putting it even simpler. What is the effect of: >>>>>>>> >>>>>>>> sqrt (-1.0) >>>>>>>> >>>>>>>> No effect? Any effect? >>>>>>> >>>>>>> This looks like an imaginary problem to me, not a real one. >>>>>> >>>>>> What problem? It was a simple question illustrating absurdity of the idea. >>>>> >>>>> Actually, a negative argument passed to sqrt is illustrating proper DbC >>>>> well. One famous example is Ariane 4, (4), that's the number four. >>>> >>>> If sqrt (-1.0) has no effect, >>> >>> First, in a DbC correct program, sqrt(r) where r < 0.0 does not occur. >> >> 1. That no correct program may have it requires a proof. > > Yes, this is why DbC is associated with a proof obligation. Yes, yes. Where is the proof? > And DbC is about two parties, not just one. And both parties belong to the same program. >> I'd rather stay on the safe side >> considering sqrt (-1.0) happen. So, what about the effect? > > If you know that you might be running an incorrect program, > the effect is similar to that of using Unchecked_Conversion. Maybe for Ada 202X, but in contemporary Ada it is Constraint_Error propagation. But wait a minute and re-read what you wrote. You say that the behaviour of sqrt(-1.0) is basically unspecified. This is where dynamic checks have led you into. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de