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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2012 Constraints (WRT an Ada IR) Date: Tue, 13 Dec 2016 22:11:39 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <47366b42-c0a3-41bf-a44a-5241c109d60f@googlegroups.com> NNTP-Posting-Host: s3c6wwRqkurrfTZpuYYZ+w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 X-Mozilla-News-Host: news://news.aioe.org X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:32785 Date: 2016-12-13T22:11:39+01:00 List-Id: On 2016-12-13 17:59, G.B. wrote: > On 13/12/2016 12:19, Dmitry A. Kazakov wrote: >> On 13/12/2016 11:39, G.B. wrote: >>> On 13/12/2016 09:27, Dmitry A. Kazakov wrote: >>> >>>>> No Ada in there. I was thinking of this posting. >>>> >>>> Ada is an object language here. Thus it can never be Ada. It could be >>>> a meta language of annotations for Ada, like SPARK. >>> >>> Pre doesn't have to be object language as has now been >>> said and confirmed a number of times. >> >> Being a part of the body it does not belong to declarations. > > Right, Pre aspects are *not* body! They are being executed at run time. >>>> It is an explicit contract. >>> >>> Can you make it a Boolean expression? >> >> That depends on the language in question. It is not an expression in >> Ada and cannot be made one. > > Please, it's simple, actually, It is a predicate which has nothing to do with Ada's Boolean expression you wrote. See another post in this thread. >>> So, what are expected values for various inputs of A and B >>> passed to Plus_Too? Can this be stated? >> >> Yes it can and it is already done by the provided implementation of >> Plus_Too. > > It needs to be stated before the fact to be useful. > > Without an implementation yet, one cannot infer its precondition. > But it is possible to write a predicate that is the specification > of a set of values from which some implementation is to compute > results. Sure, it is possible to do calculus on predicates. But Ada expression A>B is not a predicate and if not A>B then raise Constraint_Error; end if; is not calculus of predicates. > I only asked for a relation between A and B as inputs to Plus_Too. No, you asked for an Ada program that evaluates a relation in connection with the semantics of Plus_To. There is no such thing. A relation is, the program is not. Another program, e.g. SPARK may do calculus, but not the object program. There is no way you could cross that line. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de