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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b78c363353551702 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.228.227 with SMTP id sl3mr12207081pbc.5.1341555800955; Thu, 05 Jul 2012 23:23:20 -0700 (PDT) Path: l9ni11004pbj.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: about the new Ada 2012 pre/post conditions Date: Thu, 5 Jul 2012 23:23:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1mkp7fzlk1b0y.1ueinfjn48fcy$.dlg@40tude.net> <4fe72b6b$0$9504$9b4e6d93@newsspool1.arcor-online.net> <1bbvp3ghpjb5s.1go1s1qvcmagh$.dlg@40tude.net> <4fe76fad$0$9507$9b4e6d93@newsspool1.arcor-online.net> <1jt8vhzxfrv2i.eohce4d3rwx1$.dlg@40tude.net> <4fe83aaa$0$6624$9b4e6d93@newsspool2.arcor-online.net> <1pkfv0tiod3rn$.onx6dmaa3if9$.dlg@40tude.net> <1i1mp8xs3vtl2.1oc4m66qtfgzq.dlg@40tude.net> <4fe9bde5$0$6566$9b4e6d93@newsspool4.arcor-online.net> <1otknesgpcisl$.112pd12on3vsb$.dlg@40tude.net> <1etm46gu9c54e$.rkbmrzh5ia6$.dlg@40tude.net> NNTP-Posting-Host: 69.20.190.126 Mime-Version: 1.0 X-Trace: posting.google.com 1341555800 27644 127.0.0.1 (6 Jul 2012 06:23:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 6 Jul 2012 06:23:20 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <1etm46gu9c54e$.rkbmrzh5ia6$.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-05T23:23:20-07:00 List-Id: On Thursday, July 5, 2012 1:24:57 AM UTC-6, Dmitry A. Kazakov wrote: > On Wed, 4 Jul 2012 19:58:31 -0700 (PDT), Shark8 wrote: >=20 > > Also, I don't know where you got the idea that pre- and post-conditions > > must not implement anything. >=20 > Trivial: >=20 > IF pre-/post-condition is contract THEN they are not implementation > [POV #2] > ELSE ... [POV #1] Now you're just restating what you said. If you mean something like "I take= that to be axiomaatic" or "by definition [...]" there'd be something to di= scuss. As is though you're just throwing out the assertion that pre- and post-cond= itions must not have an implementation. {Otherwise they're not *real*, *con= tracted* pre- post-conditions.} this strikes me as a bit... off, considerin= g things from the other direction: how to implement [for lack of a better w= ord] pre- and post-conditions most of the method you seem to be advocating = is impossible (just like any user-input cannot be guaranteed correct w/o ei= ther having all user-input as permissible, or otherwise validating it) or d= ifficult on the compile-time/static-analysis level. > (Historically, pre-/post-conditions were invented by Dijkstra for the > purpose of proving correctness. Later they were used for types to analyze > substitutability issues etc.) And isn't the idea with Ada's constructs to at least aid proving the correc= tness of a program? Furthermore, wouldn't it be preferable to throw an exce= ption when the condition is violated? That seems to fit perfectly with such= as CONSTRAINT_ERROR or PROGRAM_ERROR, no? =20 > > If that was the case then, strictly speaking > > JavaDoc's pre and postcondition annotating comments are superior to Ada= 's > > pre and post condition because they don't implement anything and are, i= n > > fact, just comments having no actual impact on the program text. >=20 > Not if condition proof fault makes the program illegal. It does nothing, insofar as I know, regarding nprogram correctness. http://= en.wikipedia.org/wiki/Java_annotation has as an example the "override" anno= tation which when violated only provides a warning.