From rybin@possum.srcc.msu.su Sun May 11 14:12:03 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id OAA14366; Sun, 11 May 1997 14:12:02 -0400 Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us) by ida.org (4.1/SMI-4.1) id AA26875; Sun, 11 May 97 14:12:37 EDT Received: from crocus.gamma.ru by sw-eng.falls-church.va.us (8.7.1/) id RAA28200; Sun, 11 May 1997 17:46:43 GMT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id VAA29422 for asis-technical@sw-eng.falls-church.va.us; Sun, 11 May 1997 21:49:42 +0400 (MSD) Received: by gamma.srcc.msu.su; Sun, 11 May 1997 21:48:42 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Sun, 11 May 1997 21:35:21 +0400 To: asis-technical@sw-eng.falls-church.va.us Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Sun, 11 May 97 21:35:20 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Corresponding_Base_Entity question Lines: 55 Content-Length: 1568 Status: OR Hi, ASIS folks! How, do you think, what should be returned by Asis.Declarations.Coresponding_Base_Entity in the following situation: procedure Renaming is type Rec1 is record I : Integer; end record; type Rec2 is record C : Rec1; end record; type Rec3 is record Comp : Rec2; end record; X : Rec3; Y : Rec3 renames X; Var1 : Rec2 renames Y.Comp; Var2 : Rec1 renames Var1.C; Var3 : Integer renames Var2.I; -- << this is the declaration of interst begin Var3 := 13; end Renaming; ASIS definition defines this query as follows: -------------------------------------------- -- Section 15.35 function Coresponding_Base_Entity -------------------------------------------- function Coresponding_Base_Entity (Declaration : in Asis.Declaration) return Asis.Expresion; -------------------------------------------- -- Declaration - Specifies the rename declaration to query -- -- Unwinds recursive renamings to return the expresion used to name -- the first renamed entity that is not itself a renamed entity. This -- expresion is the name expresion found in the last RENAME declaration -- when folowing a chain of sucesive renaming declarations. -- -- ... But for the example above no name corresponding to the last renaming of Var2.I can be found in any of the previous renamings. So, as we can see, if in a renaming chain is some renaming of a *component* of some *previously renamed* (record) object, we have a hole in the ASIS semantics. Any comments? SErgey Rybin, ASIS-for-GNAT project. From sblake@alsys.com Mon May 12 13:16:36 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id NAA15152; Mon, 12 May 1997 13:16:36 -0400 Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us) by ida.org (4.1/SMI-4.1) id AA07866; Mon, 12 May 97 13:13:49 EDT Received: from gw.alsys.com by sw-eng.falls-church.va.us (8.7.1/) id OAA21020; Mon, 12 May 1997 14:45:19 GMT Received: from rasht.alsys.com (mailhub.alsys.com) by gw.alsys.com (4.1/SMI-4.1.1) id AA18619; Mon, 12 May 97 07:48:44 PDT Received: from puumba.telesoft by rasht.alsys.com (4.1/TS-1.2c) id AA11218; Mon, 12 May 97 07:47:15 PDT Received: by puumba.telesoft (SMI-8.6/SMI-SVR4) id HAA14837; Mon, 12 May 1997 07:47:14 -0700 Date: Mon, 12 May 1997 07:47:14 -0700 From: sblake@alsys.com (Steve Blake @pulsar) Message-Id: <199705121447.HAA14837@puumba.telesoft> To: asis-technical@sw-eng.falls-church.va.us, rybin@possum.srcc.msu.su Subject: Re: Corresponding_Base_Entity question Content-Length: 284 Status: OR There is no renaming chain in this example. While the prefix of Var2.I is a renaming, the selected component is not, thus the query should return an element representing the component declaration I : Integer;. The commentary for this function should have some word-smithing. Steve From rybin@possum.srcc.msu.su Mon May 12 13:30:11 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id NAA15159; Mon, 12 May 1997 13:30:11 -0400 Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us) by ida.org (4.1/SMI-4.1) id AA08065; Mon, 12 May 97 13:24:03 EDT Received: from crocus.gamma.ru by sw-eng.falls-church.va.us (8.7.1/) id PAA22552; Mon, 12 May 1997 15:51:40 GMT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id TAA12200; Mon, 12 May 1997 19:54:31 +0400 (MSD) Received: by gamma.srcc.msu.su; Mon, 12 May 1997 19:53:40 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Mon, 12 May 1997 19:50:36 +0400 To: asis-technical@sw-eng.falls-church.va.us, rybin@possum.srcc.msu.su, sblake@alsys.com References: <199705121447.HAA14837@puumba.telesoft> Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Mon, 12 May 97 19:50:35 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: Corresponding_Base_Entity question Lines: 36 Content-Length: 1761 Status: OR > There is no renaming chain in this example. While the prefix of Var2.I is > a renaming, the selected component is not, thus the query should return > an element representing the component declaration I : Integer;. The question is "the component declaration" of *what*? I think, the query Corresponding_Base_Entity is ill-defined, and I cannot see any reasonable way to improve its definition in a way, which would take into account *all* possible cases. The general idea of the query is to unwind renamings. That's fine. The easiest case is when we have a renaming chain, and if we can traverse it to the beginning and if we can find in the very end (in the very beginning?) the original name of the entity. But this traversal is well-defined only if every name (except the very first) can be found twice in different renaming declarations - once as a defining name and once as a name being renamed. Components of renamed objects, as well as renaming a component of a function call breaks this chain. (And I agree, that there is no "traversable" renaming chain in my original example.) I do not think, that returning a component declaration is a good solution (and why *declaration*, if in the "normal" case the query returns not a defining name, but a naming expression for some usage occurence of a name?) I think, we have only two alternatives - Nil_Element as a signal, that the "easy solution" does not work for this renaming, and that an application itself have to take care about it, or returning the argument Element as a signal, that there is no "renaming chain" which can be traversed to get the 'original' name of the "Corresponding Base Entity" > The commentary for this function should have some word-smithing. > > Steve > Sergey From roby Fri May 23 16:37:44 1997 Return-Path: Received: by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id QAA05855; Fri, 23 May 1997 16:34:26 -0400 From: roby (Clyde Roby) Message-Id: <199705232034.QAA05855@cronus.csed.ida.org> Subject: new issue #078 To: rybin@alex.srcc.msu.su (Rybin), SBlake@Aonix.Com (Steve Blake) Date: Fri, 23 May 1997 16:34:25 -0400 (EDT) Cc: roby (me), ASIS-Officers@SW-Eng.Falls-Church.Va.US (asis-officers), Alain.LeGuennec@enst-bretagne.fr X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 488 Status: OR Sergey, Steve, Sergey sent an email message with Subject "Corresponding_Base_Entity question" on 11 May; this is new Issue #078. Steve replied on 12 May indicating that word-smithing is needed; Sergey replied again on 12 May further explaining the problem. Please provide specific changes you would like to see (with exact wording, if possible) to the appropriate sections (and identify which sections). Again, we need this information by COB, Tuesday, 27 May. Clyde (and Currie) From rybin@possum.srcc.msu.su Sun May 25 14:12:30 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id OAA07684; Sun, 25 May 1997 14:12:30 -0400 Received: from crocus.gamma.ru by ida.org (4.1/SMI-4.1) id AA11242; Sun, 25 May 97 14:09:32 EDT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id WAA28391; Sun, 25 May 1997 22:08:45 +0400 (MSD) Received: by gamma.srcc.msu.su; Sun, 25 May 1997 22:08:20 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Sat, 24 May 1997 22:56:57 +0400 To: roby@ida.org, SBlake@Aonix.Com Cc: Alain.LeGuennec@enst-bretagne.fr, ASIS-Officers@SW-Eng.Falls-Church.Va.US References: <199705232034.QAA05855@cronus.csed.ida.org> Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Sat, 24 May 97 22:56:57 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: new issue #078 Lines: 71 Content-Length: 2795 Status: OR > Sergey, Steve, > > Sergey sent an email message with Subject > "Corresponding_Base_Entity question" on 11 May; this is new Issue > #078. Steve replied on 12 May indicating that word-smithing is > needed; Sergey replied again on 12 May further explaining the problem. I cannot see any good solution for this problem. It looks like the very idea of this query is ill-defined. If we have something like: type Rec is record I : Integer; ... end record; Var : Rec; Var1 : Rec renames Var; Var2 : Integer renames Var1.I; what should be returned for the last renaming declaration? Do we have any renaming chain here? I would suggest to return Nil_Element here as a signal for an application to make its own, more sophisticated analysis to get to know what really is renamed by given renaming declaration. So, below is my version. Sergey. --------------------------------------------------------------------------------------- -- Subclause 15.35 function Corresponding_Base_Entity --------------------------------------------------------------------------------------- function Corresponding_Base_Entity (Declaration : in Asis.Declaration) return Asis.Expression; --------------------------------------------------------------------------------------- -- Declaration - Specifies the rename declaration to query -- -- Unwinds recursive renamings to return the expression used to name -- the first renamed entity that is not itself a renamed entity. This -- expression is the name expression found in the last RENAME declaration -- when following a chain of successive renaming declarations. -- -- In case if it is impossible to traverse the chain of renaming declarations -- (for example, in case if a component of an already renamed object is -- renamed), a Nil_Element is returned. -- -- Appropriate Declaration_Kinds: -- An_Object_Renaming_Declaration -- An_Exception_Renaming_Declaration -- A_Procedure_Renaming_Declaration -- A_Function_Renaming_Declaration -- A_Package_Renaming_Declaration -- A_Generic_Package_Renaming_Declaration -- A_Generic_Procedure_Renaming_Declaration -- A_Generic_Function_Renaming_Declaration -- -- Returns Element_Kinds: -- Not_An_Expression -- An_Expression -- --|AN Application Note: --|AN --|AN If Corresponding_Base_Entity returns a Nil_Element, this means that it --|AN is impossible to locate in the progam text the name of the entity being --|AN renamed (for example, if some renaming declaration in the renaming chain --|AN renames a component of some already renamed enity). In this case an --|AN application shall make its own analysis to understand the meaning of --|AN a name introduced by an argument renaming declaration From sblake@sd.aonix.com Sun May 25 15:53:49 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id PAA07760; Sun, 25 May 1997 15:53:48 -0400 Received: from gw.alsys.com by ida.org (4.1/SMI-4.1) id AA11700; Sun, 25 May 97 15:54:28 EDT Received: from rasht.sd.aonix.com (mailhub.alsys.com) by gw.alsys.com (4.1/SMI-4.1.1) id AA03525; Sun, 25 May 97 12:54:08 PDT Received: from puumba.telesoft by rasht.sd.aonix.com (4.1/TS-1.2c) id AA20770; Sun, 25 May 97 12:52:29 PDT Received: by puumba.telesoft (SMI-8.6/SMI-SVR4) id MAA16615; Sun, 25 May 1997 12:52:27 -0700 Date: Sun, 25 May 1997 12:52:27 -0700 From: sblake@sd.aonix.com (Steve Blake @pulsar) Message-Id: <199705251952.MAA16615@puumba.telesoft> To: SBlake@aonix.com, roby@ida.org, rybin@possum.srcc.msu.su Subject: Re: new issue #078 Cc: ASIS-Officers@sw-eng.falls-church.va.us, Alain.LeGuennec@enst-bretagne.fr Content-Length: 3061 Status: OR >> Sergey, Steve, >> >> Sergey sent an email message with Subject >> "Corresponding_Base_Entity question" on 11 May; this is new Issue >> #078. Steve replied on 12 May indicating that word-smithing is >> needed; Sergey replied again on 12 May further explaining the problem. > >I cannot see any good solution for this problem. It looks like the very idea >of this query is ill-defined. If we have something like: > >type Rec is record > I : Integer; > ... >end record; > >Var : Rec; > >Var1 : Rec renames Var; >Var2 : Integer renames Var1.I; > >what should be returned for the last renaming declaration? > >Do we have any renaming chain here? I would suggest to return Nil_Element here My last respons to this was very misleading and wrong. I must have been thinking somewhere else at the time. Perhaps we are reading too much into this query. The intent is to simply return the expression if there is no renaming to unwind. The declaration of Var2 renames Var1.I which is itself a base entity (not a renaming provided in whole by a renaming declaration); hence there is no unwinding to do and the expression Var1.I should be returned. ASIS provides all the necessary queries to analyze Var1.I and determine that the prefix Var1 was created by a renaming, etc. Here is my suggestion for better clarifying commentary: Steve function Corresponding_Base_Entity (Declaration : in Asis.Declaration) return Asis.Expression; --------------------------------------------------------------------------------------- -- Declaration - Specifies the rename declaration to query -- -- The base entity is defined to be the renamed entity that is not itself -- another name for an entity. A component or slice of a renamed entity is -- always a base entity. -- -- If the name following the reserved word RENAMES is itself declared by a -- previous renaming_declaration, then this query unwinds the renamings by -- recursively operating on the previous renaming_declaration. -- -- Otherwise, the name following the reserved word RENAMES is returned. -- -- Appropriate Declaration_Kinds: -- An_Object_Renaming_Declaration -- An_Exception_Renaming_Declaration -- A_Procedure_Renaming_Declaration -- A_Function_Renaming_Declaration -- A_Package_Renaming_Declaration -- A_Generic_Package_Renaming_Declaration -- A_Generic_Procedure_Renaming_Declaration -- A_Generic_Function_Renaming_Declaration -- -- Returns Element_Kinds: -- Not_An_Expression -- An_Expression -- --|AN Application Note: --|AN --|AN If Corresponding_Base_Entity returns a Nil_Element, this means that it --|AN is impossible to locate in the progam text the name of the entity being --|AN renamed (for example, if some renaming declaration in the renaming chain --|AN renames a component of some already renamed enity). In this case an --|AN application shall make its own analysis to understand the meaning of --|AN a name introduced by an argument renaming declaration From rybin@possum.srcc.msu.su Mon May 26 01:51:57 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id BAA08124; Mon, 26 May 1997 01:51:56 -0400 Received: from crocus.gamma.ru by ida.org (4.1/SMI-4.1) id AA14311; Mon, 26 May 97 01:51:09 EDT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id JAA03454; Mon, 26 May 1997 09:50:46 +0400 (MSD) Received: by gamma.srcc.msu.su; Mon, 26 May 1997 09:50:06 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Mon, 26 May 1997 09:47:24 +0400 To: roby@ida.org, SBlake@aonix.com, sblake@sd.aonix.com Cc: Alain.LeGuennec@enst-bretagne.fr, ASIS-Officers@sw-eng.falls-church.va.us References: <199705251952.MAA16615@puumba.telesoft> Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Mon, 26 May 97 09:47:24 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: new issue #078 Lines: 112 Content-Length: 4869 Status: OR > >> Sergey sent an email message with Subject > >> "Corresponding_Base_Entity question" on 11 May; this is new Issue > >> #078. Steve replied on 12 May indicating that word-smithing is > >> needed; Sergey replied again on 12 May further explaining the problem. > > > >I cannot see any good solution for this problem. It looks like the very idea > >of this query is ill-defined. If we have something like: > > > >type Rec is record > > I : Integer; > > ... > >end record; > > > >Var : Rec; > > > >Var1 : Rec renames Var; > >Var2 : Integer renames Var1.I; > > > >what should be returned for the last renaming declaration? > > > >Do we have any renaming chain here? I would suggest to return Nil_Element here > > > My last respons to this was very misleading and wrong. I must have been > thinking somewhere else at the time. > > Perhaps we are reading too much into this query. The intent is to simply > return the expression if there is no renaming to unwind. The declaration of > Var2 renames Var1.I which is itself a base entity (not a renaming provided > in whole by a renaming declaration); hence there is no unwinding to do and > the expression Var1.I should be returned. ASIS provides all the necessary > queries to analyze Var1.I and determine that the prefix Var1 was created by > a renaming, etc. I would agree with Steve - may be, we should really use the simplest approach: if we have a "proper" renaming chain, we unwind renaming(s), if we do not have a chain - we return the renamed name from an argument renaming declaration. Even if we have a chain, an application should analyse the name returned to understand, what does this name mean, so an application in fact does not need (or it cannot rely on) any signal indicating, that there is no means to traverse the chain. So I vote for Steve's solution and I withdraw my own one. > > Here is my suggestion for better clarifying commentary: > Wording is another issue. First, I am afraid, there are some "traces" from my suggestion in what was sent by Steve (Not_An_Expression and "Application Note" comments). Second, I am afraid, that the definition of the notion of a "base entity" is not clear enough (or do I have a language problem here? :) So I would change it as: > > function Corresponding_Base_Entity (Declaration : in Asis.Declaration) > return Asis.Expression; > > --------------------------------------------------------------------------------------- > -- Declaration - Specifies the rename declaration to query > -- > -- The base entity is defined to be the renamed entity that is not itself > -- another name for an entity. A component or slice of a renamed entity is ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ | |_________________ I would replace this with: | "defined by another renaming declaration" | | _________________________________________| | And I would drop this (the whole sentence), because it is wrong in case if "a component or slice of a renamed entity" is itself renamed in another renaming declaration. > -- always a base entity. > -- > -- If the name following the reserved word RENAMES is itself declared by a > -- previous renaming_declaration, then this query unwinds the renamings by > -- recursively operating on the previous renaming_declaration. > -- > -- Otherwise, the name following the reserved word RENAMES is returned. > -- > -- Appropriate Declaration_Kinds: > -- An_Object_Renaming_Declaration > -- An_Exception_Renaming_Declaration > -- A_Procedure_Renaming_Declaration > -- A_Function_Renaming_Declaration > -- A_Package_Renaming_Declaration > -- A_Generic_Package_Renaming_Declaration > -- A_Generic_Procedure_Renaming_Declaration > -- A_Generic_Function_Renaming_Declaration > -- > -- Returns Element_Kinds: > -- Not_An_Expression ^^^^^^^^^^^^^^^^^^ Should be dropped if we accept Steve's suggestion > -- An_Expression > -- The following Application Note should also be dropped. > --|AN Application Note: > --|AN > --|AN If Corresponding_Base_Entity returns a Nil_Element, this means that it > --|AN is impossible to locate in the progam text the name of the entity being > --|AN renamed (for example, if some renaming declaration in the renaming chain > --|AN renames a component of some already renamed enity). In this case an > --|AN application shall make its own analysis to understand the meaning of > --|AN a name introduced by an argument renaming declaration > >