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!proxad.net!npeer.de.kpn-eurorings.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newspeer2.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, sv-se, sv-fi, en-gb, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is T an ancestor of T? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Wed, 20 Oct 2004 16:18:24 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1098289104 217.209.116.179 (Wed, 20 Oct 2004 18:18:24 CEST) NNTP-Posting-Date: Wed, 20 Oct 2004 18:18:24 CEST Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:5528 Date: 2004-10-20T16:18:24+00:00 List-Id: Georg Bauhaus wrote: > Christoph Karl Walter Grein wrote: > : From: Georg Bauhaus > :=20 > :> I still don't know whether or not a type is an ancestor of itself, > :> given that it is a descendant of itself. > :=20 > : Looking into RM Index for ancestor, you'll find the reference to RM 3= =2E4.1(10) with the definition of ancestor and descendant: >=20 > Yes, descendant seem clearly defined in this paragraph. Then I'd say "ancestor" is also clearly defined: "If a type T2 is a=20 descendant of a type T1, then T1 is called an ancestor of T2." So if T=20 is a descendant of T, then T is an ancestor of T. > However, > "The ultimate ancestor of a type is the > ancestor of the type that is not a descendant of any other type." The one ancestor that isn't a descendant of any type other than itself,=20 that is, the one that isn't derived, is the ultimate ancestor. At least=20 that's how I read that. Are you reading the annotated or non-annotated manual? The annotated one = has a lot more to say about this, including some examples: 10 A specific type T2 is defined to be a descendant of a type T1 if T2 is=20 the same as T1, or if T2 is derived (directly or indirectly) from T1. A=20 class-wide type T2'Class is defined to be a descendant of type T1 if T2=20 is a descendant of T1. Similarly, the universal types are defined to be=20 descendants of the root types of their classes. If a type T2 is a=20 descendant of a type T1, then T1 is called an ancestor of T2. The=20 ultimate ancestor of a type is the ancestor of the type that is not a=20 descendant of any other type. 10.a Ramification: A specific type is a descendant of itself. Class-wide=20 types are considered descendants of the corresponding specific type, and = do not have any descendants of their own. 10.b A specific type is an ancestor of itself. The root of a derivation class = is an ancestor of all types in the class, including any class-wide types = in the class. 10.c Discussion: The terms root, parent, ancestor, and ultimate ancestor are=20 all related. For example: 10.d * Each type has at most one parent, and one or more ancestor types; = each type has exactly one ultimate ancestor. In Ada 83, the term=20 ``parent type'' was sometimes used more generally to include any=20 ancestor type (e.g. RM83-9.4(14)). In Ada 95, we restrict parent to mean = the immediate ancestor. 10.e * A class of types has at most one root type; a derivation class=20 has exactly one root type. 10.f * The root of a class is an ancestor of all of the types in the=20 class (including itself). 10.g * The type root_integer is the root of the integer class, and is=20 the ultimate ancestor of all integer types. A similar statement applies=20 to root_real. --=20 Bj=F6rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu