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=unavailable 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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada 2012 Constraints (WRT an Ada IR) Date: Mon, 19 Dec 2016 16:33:07 -0600 Organization: JSA Research & Innovation Message-ID: References: <1af458a8-cf5b-4dd7-824d-eed1ed5ffb21@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1482186788 21702 24.196.82.226 (19 Dec 2016 22:33:08 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 19 Dec 2016 22:33:08 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Response Xref: news.eternal-september.org comp.lang.ada:32914 Date: 2016-12-19T16:33:07-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:o32vjg$1jv4$1@gioia.aioe.org... > On 2016-12-16 20:51, Randy Brukardt wrote: ... >> The path was that set by Ada 83 with the idea of constraints. By your >> model, >> constraint checks belong to the implementation, and those have always >> been >> exposed in the specification. > > Not explicitly. It is like the implementation of "+" when an integer type > declared. The implementation is assumed but not specified. Explicitly, by the semantic model I quoted earlier. >> Later versions of Ada have just built on this >> already existing (and very successful) idea, extending it to further >> cases. > > I meant explicit code snippets in declarations, which includes "is null", > checks, etc. > > It is very different from having type operations producing new [sub]types > like > > subtype Y is X range 1..100; > > or > > type T is array (I) of E; > > They declare and implement operations implicitly. Only in your world-view, not the official Ada semantics, for a subtype. Operations are only declared for a type, not a subtype (and the location of declaration matters). And I'm not sure why subtype Y is X range 1 .. 100; is OK and subtype Z is X with Static_Predicate => Z > 0; is not. They both have explicit declarations of the subtype, and the semantics is effectively the same. Randy.