comp.lang.ada
 help / color / mirror / Atom feed
From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: about inheritance of subtypes and entities (such as constants) related to a type in the same package
Date: Thu, 31 May 2018 14:10:55 -0700 (PDT)
Date: 2018-05-31T14:10:55-07:00	[thread overview]
Message-ID: <37019e2f-b374-483a-aa62-4a76dcc568f6@googlegroups.com> (raw)
In-Reply-To: <pepk7g$1pu5$1@gioia.aioe.org>

On Thursday, May 31, 2018 at 2:59:48 PM UTC-5, Dmitry A. Kazakov wrote:
> On 2018-05-31 20:53, Dan'l Miller wrote:
> > On Thursday, May 31, 2018 at 12:37:07 PM UTC-5, Dmitry A. Kazakov wrote:
> >> On 2018-05-31 04:29 PM, Dan'l Miller wrote:
> >>> Conversely, subtyping in Ada does none of that type-extension stuff:  no
> >>>   additional data/cardinality-of-the-members-of-the-set, no additional
> >>   > routines/behavior, no arbitrary refinement of behavior of overridden/copied
> >>>   routines/operations.  Instead, subtyping in Ada is strictly subjecting the
> >>>   parent type to an additional membership-narrowing predicate, such as subset
> >>   > in set theory.  Randy likewise spoke of membership on other branches of this
> >>   > thread.
> >>
> >> Untrue. Ada 83 subtyping extends the supertype (base type), because it
> >> exports operations defined on the subtype to the base type. Ada 83
> >> subtyping introduces an equivalent type, which is both sub- and
> >> supertype of the base.
> > 
> > If Ada83 untagged subtyping is type extension, please provide even a single characteristic that was extended/added/supplemented instead of contracted/subtracted/elided by the predicate.
> 
> Elementary:
> 
>     subtype Extension is Integer;
>     procedure Extended_Operation (X : Extension) is null;
>     X : Integer;
>     Y : Extension;
> begin
>     Extended_Operation (X); -- See #1
>     Extended_Operation (Y); -- See #2

There is exactly one procedure Extended_Operation, which despite its cleverly-deceptive name is not a demonstration of type extension:  We start with having a single procedure that takes X as a parameter and that is precisely where we end:  no new procedure for Y, no additional storage for Y beyond Y's Xness, no new outcome in the execution of that procedure when passed a Y (except enforcement of the [unfortunately-missing] predicate as a post-condition).

Or in fewer words:  nothing about Y is X-plus-more.  There is no "more" there.
(not even a predicate to enforce, which would have made this example a tad juicier).

> The subtype Extension extends Integer with Extended_Operation, which has 
> two separate meanings:
> 
> 1. The base type Integer has now a new operation:
> 
>     new Integer interface = old Integer interface + Extended_Operation
> 
> 2. The subtype Extension extends inherited Integer's set of operations:
> 
>     Extended interface = old Integer interface + Extended_Operation

Invoking the same subprogram again (even with a potentially-created temporary) is not adding something to X to make a bigger-better Y.  Type extension needs some sort of •extension• whatsoever.  Extension whatsoever needs something extant to have been added/supplemented/made-more-of-it, e.g., additional storage, additional subprograms (not the same one invoked twice), additional something-quantifiable or something-tangible beyond mere narrowed post-condition range enforcement and beyond mere temporary creation iff Y's representation were to differ from X's (due to some range-restriction predicate, which was unfortunately omitted here).

Perhaps something is getting lost in translation to a nonEnglish language at the fundamental meaning-of-words level:  extend is ex- (outside of) + -tend (to regularly have a characteristic) so, by those lexemes, Y extends X directly means Y regularly has a characteristic outside of X, where characteristic is not empty set and where "outside of X" is beyond X's well-defined perimeter of self that demarcates X from all things not-X in the universe.  Y has no such extant characteristic that you or I can point to (e.g., what's its name?; where's its storage?; what's its lifetime?) that exists somewhere/anywhere in the not-X universe.  (And I don't count Y's would-be predicate, because the entire purpose of the predicate is to be subtractive/restrictive to be less-of-X, not expansively X-plus-more.)

Y merely copied some characteristics (but not others, depending on the would-be predicate) from a prior exemplar named X.  Y can be utilized wherever the exemplar was utilized.  Nothing more.  And it is that "more" there for which we are so desperately looking:  the extant expansionistic/not-contractionistic thingy that Y tended to be outside of being an X.  Y needs to find that quantifiable/tangible extant thingy outside of being an X to be an extension, to then in turn be type extension.  Nothing in Y outside of its Xness would imply no extension.  No extension would imply no type extension in Ada83's subtyping.  No type extension would imply no inheritance in Ada83's subtyping.  And when we went on that safari-hunt for that "more" thingy there, we found "nothing".  Nothing is not an extant thingy.  That chain of sought-for implications are thus true.  Q.E.D.


  reply	other threads:[~2018-05-31 21:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-26 16:14 about inheritance of subtypes and entities (such as constants) related to a type in the same package Mehdi Saada
2018-05-26 16:44 ` Mehdi Saada
2018-05-29 22:07   ` Randy Brukardt
2018-05-29 22:12 ` Randy Brukardt
2018-05-30  8:13   ` Dmitry A. Kazakov
2018-05-30 19:25     ` Randy Brukardt
2018-05-30 19:45       ` Dmitry A. Kazakov
2018-05-30 19:59         ` Randy Brukardt
2018-05-31  8:44           ` Dmitry A. Kazakov
2018-05-31 22:48             ` Randy Brukardt
2018-05-31 23:39               ` Mehdi Saada
2018-06-01  2:50                 ` Shark8
2018-06-01  7:35                 ` Dmitry A. Kazakov
2018-05-30 20:53   ` Dan'l Miller
2018-05-31  8:54     ` Dmitry A. Kazakov
2018-05-31 14:29       ` Dan'l Miller
2018-05-31 14:38         ` Dan'l Miller
2018-05-31 17:37         ` Dmitry A. Kazakov
2018-05-31 18:53           ` Dan'l Miller
2018-05-31 19:59             ` Dmitry A. Kazakov
2018-05-31 21:10               ` Dan'l Miller [this message]
2018-06-01  7:56                 ` Dmitry A. Kazakov
2018-06-01 14:01                   ` Dan'l Miller
2018-06-01 15:27                     ` Dmitry A. Kazakov
2018-05-31 22:45             ` Randy Brukardt
2018-05-31 23:50               ` Dan'l Miller
2018-06-01  7:38               ` Dmitry A. Kazakov
2018-05-31 22:34     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox