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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Preconditions which anyway would be caught? Date: Mon, 11 Aug 2014 09:31:07 +0200 Organization: cbb software GmbH Message-ID: <1b5ytxppxisxu$.nom2sfczulhi$.dlg@40tude.net> References: <7vydnShDldsh6XvO4p2dnAA@giganews.com> <14zsfaffv1uwu.12pijzz9mdaj8$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: yj8+JIQUMOEawvIM7K49kA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21654 Date: 2014-08-11T09:31:07+02:00 List-Id: On Sun, 10 Aug 2014 18:00:36 -0600, Shark8 wrote: > On 10-Aug-14 01:24, Dmitry A. Kazakov wrote: >> Specifying precondition for the sake of having them is meaningless. > > Not all preconditions imply a post-condition; sometimes it's simply to > constrain the values that you're willing to entertain; All. > for example if > you have Natural_Float being a subtype of float (range 0.0 .. > Float'Last) you could use this in an internal simple simulator with > Square_Root(X: Natural_Float) return Float being a function therein. The precondition of Square_Root en-force is True, thus calling Square_Root (-1.0) is not an error. Constraints are "dynamic preconditions" in Ada 2012 Newspeak. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de