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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!87.79.20.105.MISMATCH!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Preventing type extensions Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <874odv9npv.fsf@ludovic-brenta.org> <87y6b7cedd.fsf@mid.deneb.enyo.de> <66a3704c-54f9-4f04-8860-aa12f516134b@t3g2000vbb.googlegroups.com> <87d3sib44t.fsf@mid.deneb.enyo.de> <134q4k2ly2pf4$.17nlv1q6q5ivo.dlg@40tude.net> <4c8dec8e$0$6990$9b4e6d93@newsspool4.arcor-online.net> <8f6cceFrv2U1@mid.individual.net> <135a7dc9-3943-45e4-884b-3cc6bce3db0a@q18g2000vbm.googlegroups.com> <10rutrnp4yp1b$.vxcbtginicg9.dlg@40tude.net> <1rwwxbzfj78eh.6l7isp9fciba$.dlg@40tude.net> <4c98e745$0$7667$9b4e6d93@newsspool1.arcor-online.net> <1qwl6jiun2mik$.s1k2xnzg8dv6$.dlg@40tude.net> <8g3nflFnruU1@mid.individual.net> <9d1804mxit9j$.wyo5zgwjxh71.dlg@40tude.net> <8g46hgFkfqU1@mid.individual.net> Date: Fri, 24 Sep 2010 21:42:55 +0200 Message-ID: <35xk9dvvqf5w$.1513cydyl2whf$.dlg@40tude.net> NNTP-Posting-Date: 24 Sep 2010 21:42:54 CEST NNTP-Posting-Host: ef641b7d.newsspool1.arcor-online.net X-Trace: DXC=]K^@WlZ>JPUYI9]OHn9o5^ic==]BZ:af^4Fo<]lROoRQ<`=YMgDjhgRfcXS1NNXb[Z[6LHn;2LCV^[ On Fri, 24 Sep 2010 20:47:28 +0300, Niklas Holsti wrote: > Dmitry A. Kazakov wrote: >>> The property "all horses have hooves" expresses a universal property of >>> horses: if X is a horse, then X has hooves. The statement "some horses >>> have tentacles" says nothing about any given horse X. >> >> Both are predicates: > > No, they are formulas. "has_hooves(X)" is a predicate that can be true > or false for a given object X. The objects there are types. > A consequence is that LSP depends not only on the static properties of > objects (has_hooves) but also on the set of "mutating" operations. It depends on the properties of the set as a whole. Properties of individual objects cannot be contained they leak into the whole set and other types involved in the operations. > If we > were to define a Rectangle class that did not allow independent setting > of width and height, but only a uniform size scaling, Squares would be > an LSP subtype of these Rectangles. which would be forall s in Size, exists r in Rectangle, such that Height(r)=s and Width(r)=s Existential quantification cannot be avoided. Using mutators instead of results does not help. One could possibly limit LSP by narrowing the set of properties under consideration in an attempt to make it working. However, my impression is that the point where it starts working, is exactly one, where the corresponding subtype becomes useless. I considered LSP in a usable form, where, inevitably, nothing is a subtype of anything but itself. The other end is: anything is substitutable when types are OK (no properties beyond type membership). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de