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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5cf5e9dc8a9b809e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII X-Received: by 10.68.161.163 with SMTP id xt3mr4144285pbb.7.1362609355276; Wed, 06 Mar 2013 14:35:55 -0800 (PST) Path: jm3ni36097pbb.0!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!usenet.blueworldhosting.com!xmission!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Meaning of =?utf-8?Q?=E2=80=9Ccontractual=E2=80=9D?= according to Ada Date: Wed, 06 Mar 2013 17:35:54 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1362609354 28142 192.74.137.71 (6 Mar 2013 22:35:54 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 6 Mar 2013 22:35:54 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:E/nWG/HXkxCHcrquzjEWuKV8VGQ= X-Received-Bytes: 2523 Content-Type: text/plain; charset=macintosh Content-Transfer-Encoding: 8bit Date: 2013-03-06T17:35:54-05:00 List-Id: "Yannick Duch�ne (Hibou57)" writes: > Because naming and wording matters, especially with Ada :-P , I have > this question. > > http://www.ada-auth.org/standards/12rat/html/Rat12-2-5.html > Says: >> These are not really contractual in the sense thatpreconditions, >> postconditions and invariants arecontractual but are more akin to >> constraints. > > What's not contractual with subtype predicates? And so what does > �contractual� means exactly for Ada's definition authors? There's no Ada-specific meaning for "contractual". You are quoting the Rationale, not the RM. ;-) If you have a formal parameter of subtype T, then T's predicate forms part of the contract between the procedure body and its callers. So does T's constraint. So I'd say predicates and constraints are "contractual" in that sense. I think what John means is that predicates (like constraints) can be used in cases like "X := Y + 1;" where there's no clear boundary between abstractions, with a contract between those abstractions. It's just checking that Y+1 obeys the constraints and predicates of X. John is right that predicates are like constraints. In fact, if I could turn back the clock, I'd get rid of constraints, and just use predicates. And I'd call them "invariants". We've got a bit of a mess: 5 or 6 kinds of constraint, "not null", predicates, and invariants, all of which are basically the same thing, with differences in minor details. I'd prefer a language design that unified all those things. - Bob