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: a07f3367d7,146d9a693430fff2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 21 Jun 2011 14:17:11 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada2012 Invariants and obaque types References: <239a78ad-0937-4a7a-8163-231430fd5ffe@k27g2000yqn.googlegroups.com> <17t4afbmsrbm4.7llaajq91zz3.dlg@40tude.net> In-Reply-To: <17t4afbmsrbm4.7llaajq91zz3.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4e008bc8$0$6568$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 21 Jun 2011 14:17:12 CEST NNTP-Posting-Host: 81a1a104.newsspool3.arcor-online.net X-Trace: DXC=HL7Mii<>[A4L2C_`koXfC5McF=Q^Z^V384Fo<]lROoR18kF_5CCM><;?nc\616M64>:Lh>_cHTX3j=fN3DTSl=aJ< X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:19980 Date: 2011-06-21T14:17:12+02:00 List-Id: On 21.06.11 14:08, Dmitry A. Kazakov wrote: > On Tue, 21 Jun 2011 01:53:31 -0700 (PDT), Martin wrote: > >> package P1 is >> type T1 is tagged private >> with Invariant => Is_Valid (T1); > > Unrelated to Ada, but in theory, an invariant is a private implementation > dependent thing. An invariant is trivially true in all public views of the > object, i.e. between any two calls to the object's operations. From that > follows, when mentioned in a public part then: > > type T1 is tagged private with Invariant => True; > > (Again, I don't know which ideas Ada designers had about invariants, I am > not a language lawyer.) In another theory, the invariant may express things such as Num_Green_Lights (T1) >= 3; or 'Length < State_of_Things (T1) * 2; where Num_Green_Lights is a publicly visible function whose result is somehow computed. These predicates would be informative, and formal. Would they be private implementation dependent things? Or could I expect, seeing the public view and its invariant, the possibility of different implementations (of both the view and the invariant)?