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,2ff5c149712ec0eb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 29 May 2007 01:00:33 +0200 From: Georg Bauhaus Organization: # User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Interfaces and the Liskov Substitution Principle References: <1179953657.839272.160320@a26g2000pre.googlegroups.com> <1179991769.376381.252010@m36g2000hse.googlegroups.com> <12h6mi42jcha0.7f9vfsnihjwr$.dlg@40tude.net> <1180003336.1163.29.camel@kartoffel> <83abvs7sa9.fsf@hod.lan.m-e-leypold.de> <465aa5ba$0$23147$9b4e6d93@newsspool1.arcor-online.net> <12abvpqcff.fsf@hod.lan.m-e-leypold.de> In-Reply-To: <12abvpqcff.fsf@hod.lan.m-e-leypold.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <465b5e75$0$6397$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Date: 29 May 2007 00:57:57 CEST NNTP-Posting-Host: dd5286e0.newsspool2.arcor-online.net X-Trace: DXC=f0A`W`B6XfD02Sh8E_NfIAA9EHlD;3YcB4Fo<]lROoRA8kFejVHRcNe;hJ?UXAfjPKn>FWO_H X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15956 Date: 2007-05-29T00:57:57+02:00 List-Id: Markus E Leypold wrote: > >> I bet that as soon as someone popularizes a mathematical model >> If I had the money, I'd put up a challange that triggers some >> programming oriented model research > Somehow you seem to think, we can just do away with the models, if we > just approach it right. No. We might profit from mathematical models that are even better because they better reflect what programming staff needs. (Reminds me of the intent that has led to Ada.) Perhaps this was misleading: >> Until then, only this or that kind of variance is allowed to exist, >> for either mathematical or problem domain reasons, because the >> other solution cannot but create an unmaintainable mess... WRT variance, one of Meyer's examples is the allocation of boys and girls to dormitories.(*) Boys and girls are two sexes of the human kind, hence Boy and Girl are derived from the type Human. Girls' dormitories and boys' dormitories are two derived types of domitories. There is a procedure for each Human object, say Person, Person.Accomodate(dorm => ?Dormitory?); that will place a person in a dormitory, such that girls sleep in the girls' dormitory and boys sleep in the boys' dormitory. Shall we have a procedure for boys (or girls) that just takes a person of the respective sex and places the person in a dormitory'class? procedure Accomodate(who: Boy; dorm: Dormitory'class); (Of course, the "moral rule" depends on who you ask, but this example presumes gender segregation in any sexual sense.) There is a subsection in the corresponding section (OOSC2, �17) entitled "Polymorphic perversity". It alludes to the consequences of different "co/contravariance policies", speaking about a procedure that expresses "sharing a room". type Boy is new Human with private; overriding procedure Share(self: in out Boy; other: in out Boy); This definition meets the requirement that a boy and a girl shall not share a room. OTOH, there are also technical arguments in favor of defining a procedure that doesn't vary in the same "direction" as the type, thus type Boy is new Human with private; overriding procedure Share(self: in out Boy; other: in out Human'class); Which co/contravariance policy is right? And therefore, can we decide which model is the right one if all that we can say about a model is that it is mathematically sound in some sense? Of course it is, but soundness is very likely just a necessary precondition. Whether a model is sufficient, and more precisely, in which cases it is sufficient, these are the more interesting questions (to me, at least). (*) (There are certainly other solutions that do not involve inheritance, but this is the illustration given. I'm varying it slightly.)