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,73057f1a3ca11607 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!news-mue1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Is T an ancestor of T? Date: Fri, 22 Oct 2004 02:27:26 +0000 (UTC) Organization: GMUGHDU Message-ID: References: NNTP-Posting-Host: l1-hrz.uni-duisburg.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: a1-hrz.uni-duisburg.de 1098412046 10689 134.91.1.34 (22 Oct 2004 02:27:26 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Fri, 22 Oct 2004 02:27:26 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:5612 Date: 2004-10-22T02:27:26+00:00 List-Id: Bj�rn Persson wrote: : Georg Bauhaus wrote: : :> So we know there is exactly one ultimate ancestor for each type T. :> If T is at the root of a derivation hierarchy of height 0, :> is there a named type that is the ultimate ancestor of T? :> Is it T? By 10.d I would say yes. : : Yes. : :> By the last sentence of (10), :> the ultimate ancestor (T) "is not a descendant of any other type". :> So if T is the ultimate ancestor, it is not a descendant of T. :> Which it is by the first sentence of (10). :> I must be missing something. Specific types? : : Maybe it's the word "other" you're missing? I don't speak English. Is there a mix of defined (linguistic) "ambiguity" (T descends from itself) and assumed clarity of "other" in this paragraph? (Is there a well defined mathematical meaning of "other" in general, not just in paragraph 3.4.1(10)? What is the set of "not any other types"?) Adding to the quote from Douglas Adams about the descendence issue, here is one that I remembered when I thought about "other" once more. It is by M. Kline, and is quoted in some other book, so I don't know the reference details. "When a twelfth century youth fell in love he did not take three paces backward, gaze into her eyes, and tell her she was too beautiful to live. He said he would step outside and see about it. And if, when he got out, he met a man and broke his head--the other man's head, I mean--then that proved that his--the firsts fellow's--girl was a pretty girl. But if the other fellow broke _his_ head--not his own, you know, but the other fellow's--the other fellow to the second fellow, that is, because of course the other fellow would only be the other fellow to him, not the first fellow who--well if he broke his head, then _his_ girl--not the other fellow's, but the fellow who was the--Look here, if A broke B's head, then A's girl was a pretty girl; but if B broke A's head, then A's girl wasn't a pretty girl, but B's girl was." I think the issue (or my problem if you wish) might have to do with the non-natural semantics of mathematical usage (descendant of self etc ...). Here is one that has caused headaches many times (it's even reported in well know standard works of math "basics", like in Halmos'). "It" has also caused an internal assertion failure in ObjectAda when I "misspelled" part of the following procedure, writing some text that was not an extension aggregate ;-) In one of my favorite programming books the authors tell their readers that a datatype shish_kebab = Skewer | Onion of shish_kebab | Lamb of shish_kebab | Tomato of shish_kebab. They go on that if you have just a Skewer, there are only Onions on this particular shish_kebab which is just a Skewer. Well... There are no Onions at all and therefore there are only Onions on a shish_kebab? (Felleisen/Friedman, The Little MLer, Sec. 2) Anyway, with Answer; use Answer; procedure answer_test is begin if true = only_onions(Skewer' (null record)) and true = only_onions(Onion' (on => new Skewer)) and not true = only_onions(Lamb' (on => new Skewer)) and not true = only_onions(Onion' (on => new Lamb' (on => new Onion' (on => new Skewer)))) then raise Mathematical_Reasoning; end if; end answer_test; package Answer is type Skewer is tagged null record; type Shish_Kebab is access all Skewer'class; function only_onions (s: Skewer) return Boolean; type Onion (on: Shish_Kebab) is new Skewer with null record; function only_onions (s: Onion) return Boolean; type Lamb (on: Shish_Kebab) is new Skewer with null record; function only_onions (s: Lamb) return Boolean; type Tomato (on: Shish_Kebab) is new Skewer with null record; function only_onions (s: Tomato) return Boolean; end Answer; package body Answer is function only_onions (s: Skewer) return Boolean is begin return true; end only_onions; function only_onions (s: Onion) return Boolean is begin return only_onions(s.on.all); end only_onions; function only_onions (s: Lamb) return Boolean is begin return false; end only_onions; function only_onions (s: Tomato) return Boolean is begin return false; end only_onions; end Answer; -- Georg Bauhaus : By the way, did you notice that class-wide types aren't ancestors or : descendants of themselves? Yes, and class-wide types don't have parents or ancestors at all, do they?