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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.61.102 with SMTP id a93mr16247699otc.147.1481057471181; Tue, 06 Dec 2016 12:51:11 -0800 (PST) X-Received: by 10.157.56.132 with SMTP id p4mr4184810otc.20.1481057471134; Tue, 06 Dec 2016 12:51:11 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!n6no3479097qtd.0!news-out.google.com!j8ni4315qtc.0!nntp.google.com!p16no3478253qta.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 6 Dec 2016 12:51:10 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=67.0.242.189; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 67.0.242.189 References: <92ed75e9-baae-455c-9e34-53348dc6eaef@googlegroups.com> <03847fd7-5699-48de-bb3c-ef5512398f26@googlegroups.com> <3ef819e8-55f7-4ef7-9f37-77e6abc33f98@googlegroups.com> <47366b42-c0a3-41bf-a44a-5241c109d60f@googlegroups.com> <58f477d2-8b01-4001-bad8-47ea73424f4c@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6e206c3b-d4a8-44ab-9e0e-adb0924983ef@googlegroups.com> Subject: Re: Ada 2012 Constraints (WRT an Ada IR) From: Shark8 Injection-Date: Tue, 06 Dec 2016 20:51:11 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:32640 Date: 2016-12-06T12:51:10-08:00 List-Id: On Monday, December 5, 2016 at 3:13:42 PM UTC-7, Dmitry A. Kazakov wrote: > On 2016-12-05 19:42, Shark8 wrote: > > > And now we come back full-circle to the topic of the thread: > > > > Subtype P0 is Integer range 1..Integer'Last; > > Subtype P3 is Integer with > > Static_Predicate => P3 in 1..Integer'Last, > > Predicate_Failure => raise Constraint_Error; > > > > are conceptually the same thing > > What makes you think so? > > > Since these are conceptually the same, > > They are not, so long the programmer intentions are unclear. [They also > behave differently for some operations]. > > P0 is numeric range constraint. It is a well defined mathematical > concept the subtype models. > > P1 is an arbitrary predicate supposedly expresses programmer's intention > unstated. > > P0 is a contract (contiguous numeric subset) and implementation (built-in) > > P1 is an implementation and no contract. > > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de That's funny --- there's no P1 in the post you replied to.