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: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: What about a Static_Assertion? Date: Tue, 23 Jul 2013 22:13:15 +0200 Organization: cbb software GmbH Message-ID: <1lweclh4w5alc.t5jnwoiohwqw.dlg@40tude.net> References: <7thagxnbdrkc$.1byplk3eqgza4.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: q/ev1P9zCVSwu+vpMGX5Tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 2282 Xref: number.nntp.dca.giganews.com comp.lang.ada:182663 Date: 2013-07-23T22:13:15+02:00 List-Id: On Tue, 23 Jul 2013 20:57:05 +0200, Yannick Duchêne (Hibou57) wrote: > Le Tue, 23 Jul 2013 20:43:19 +0200, Dmitry A. Kazakov > a écrit: > >> On Tue, 23 Jul 2013 20:07:54 +0200, Yannick Duchêne (Hibou57) wrote: >> >>> Don't you believe it would be great to have static assertion just like >>> we have static predicates? >> >> What is the difference between assertion and precondition or invariant? > > An assertion may applies to multiple things at a time. I like to see an > assertion as hypothesis (and I prefer the hypothesis to be statically > checkable :-P ), and it is an hypothesis I may refer to from multiple > place in a package (although I may like to duplicate it in multiple case), > not from a single sub‑program. This does not make any sense. Provided we are talking about static things, they by definition hold to the program as a whole. > By the way, I don't believe assertions are seen as a deprecated feature, > and that suggest from many one's eyes, it is indeed different and can't be > replaced by the actual predicates. Predicate by definition is a Boolean expression. http://en.wikipedia.org/wiki/Predicate_%28mathematical_logic%29 Assertion, precondition, postcondition, invariant are all predicates. What Ada 2012 calls "static predicate" is also a predicate. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de