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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public From: nospam@thanks.com.au (Don Harrison) Subject: Re: Precondition Checking For Ada 0X (Was: Separation of IF and Imp: process issue?) Date: 1997/09/17 Message-ID: #1/1 X-Deja-AN: 273177194 Sender: news@syd.csa.com.au References: <341eac5e.0@news.uni-ulm.de> Reply-To: nospam@thanks.com.au X-Nntp-Posting-Host: dev50 Organization: CSC Australia, Sydney Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-17T00:00:00+00:00 List-Id: Joerg Rodemann wrote: :Don Harrison (nospam@thanks.com.au) wrote: : :> private :> type Root_Stack is abstract tagged record :> ... :> invariant :> Full (Current) implies not Empty (Current); :> Empty (Current) implies not Full (Current); :> end record; :> end Pkg; : :Well, this is a solution that seems possible to me. Of course anything the :invariant depends on has to be declared within the the spec although this :might be in the private part. This should not be a problem since it seems :quite convenient among Ada programmers to declare everything before use. Not a problem if you're inured to having to pre-declare things. :) :Thus invariants should be preceded by the declaration of any variable or :method used for its definition. This is a classic example of the problems incurred by forced dependency ordering. You can't define an invariant consisting of operations on a type without first declaring the operations. But you can't define the operations until you've declared the type (containing the invariant)! You're forced to pre-declare and suffer the maintenance burden that goes with it. :( Don. (Reverse to reply) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison au.com.csa.syd@donh