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: 103376,ad06d2d7cb045687 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.222.71 with SMTP id qk7mr11327141pbc.1.1328539155874; Mon, 06 Feb 2012 06:39:15 -0800 (PST) Path: lh20ni267093pbb.0!nntp.google.com!news2.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Silly and stupid post-condition or not ? Date: Mon, 06 Feb 2012 09:39:14 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <82wr86fzos.fsf@stephe-leake.org> <5af407fc-2868-44ca-84d2-c51a2a64104d@o4g2000pbc.googlegroups.com> <82k445fu9n.fsf@stephe-leake.org> <82ty36urik.fsf@stephe-leake.org> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1328539154 13148 192.74.137.71 (6 Feb 2012 14:39:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 6 Feb 2012 14:39:14 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:zn8Wdalw/5L4c6ptTp/tvSAJLJc= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2012-02-06T09:39:14-05:00 List-Id: "Yannick Duchêne (Hibou57)" writes: > Seems nice, but given this… > > subtype Image_Type is String > with Static_Predicate => Image_Type'Length in Length_Type; > > function Image (Instance : Instance_Type) return Image_Type > with Post => > (Parsed (Image'Result).Status = Parsed) and > (Parsed (Image'Result).Instance = Instance); > -- Result can always be successfully parsed and the resulting > -- instance is always equal to the one whose image is returned. > > …how do I move Image's Post predicate to an Image_Type's dynamic > predicate ? I could not figure the syntax nor if it's at least possible. Not possible. Predicates can only express a property of a single thing, but here you're trying to express a relationship between two things (parameter and result). - Bob