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: Tue, 6 Dec 2016 17:23:53 -0600 Organization: JSA Research & Innovation Message-ID: References: <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> <6e206c3b-d4a8-44ab-9e0e-adb0924983ef@googlegroups.com> <10e8cb52-1cbd-40ed-ba11-f474c2263ced@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1481066589 21857 24.196.82.226 (6 Dec 2016 23:23:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 6 Dec 2016 23:23:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:32645 Date: 2016-12-06T17:23:53-06:00 List-Id: "Shark8" wrote in message news:10e8cb52-1cbd-40ed-ba11-f474c2263ced@googlegroups.com... >On Tuesday, December 6, 2016 at 2:07:07 PM UTC-7, Dmitry A. Kazakov wrote: >> >> P1 = P3, sorry > >It's ok, I was just giving you a hard time. > >But something did occur to me in the interim: > >One reason that an IR could be handy is as an execution model -- like how >Intel's iAPX 432 was designed for Ada's feature-set -- having a generalized >form for constraints/violations would mean that the the chip would only >have >to handle one kind of constraint-type instead of having to have specialized >forms for P3 and P0. You seem to be assuming that it is practical to represent all kinds of predicates as some sort of set. That's definitely not true; one of the major reasons that you can't use divide or mod in a static predicate is the difficulty of representing the set. For instance, consider: subtype Even is new Natural with Dynamic_Predicate => Even mod 2 = 0; If Natural is a 64 bit type, Even is a set of 2**63 items, no two are contiguous. The representation of that is going to be a problem. One could imagine some special case to deal with this particular case, but then there are many other possible predicates with this property. Thus, your hypothetical IR would have to represent ranges as predicates, rather than as some sort of set. But that would make it hard to do operations on the IR (such as merging and check elimination). Randy.