From rybin@possum.srcc.msu.su Mon Apr 28 07:18:54 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id HAA29696; Mon, 28 Apr 1997 07:18:54 -0400 Received: from crocus.gamma.ru by ida.org (4.1/SMI-4.1) id AA28837; Mon, 28 Apr 97 07:19:16 EDT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id PAA21414; Mon, 28 Apr 1997 15:18:57 +0400 (MSD) Received: by gamma.srcc.msu.su; Mon, 28 Apr 1997 15:18:52 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Mon, 28 Apr 1997 15:17:46 +0400 To: asis-technical@sw-eng.falls-church.va.us Cc: roby@ida.org Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Mon, 28 Apr 97 15:17:46 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: renaming-as-body and renaming-as-declaration in ASIS Lines: 26 Content-Length: 1143 Status: OR Hi, ASIS folks! Suppose we have a declaration of the procedure Foo. and it is completed by ranaming-as-body. There is a way to go from the declaration to this (renaming-as-)body - to apply Asis.Declarations.Corresponding_Body. But the question is - how to go from this (renaming-as-)body (which plays the role of a body) to the (corresponding!) declaqration of Foo? The documentation of Asis.Declarations.Corresponding_Declaration says, that for A_Function_Renaming_Declaration and A_Procedure_Renaming_Declaration *the argument Declaration should be returned, but it means, that this query does not make any difference between renaming-as-declaration and renaming-as-body. Did I miss something important? If I did not, it looks like there is a bug in the ASIS definition, and Asis.Declarations.Corresponding_Declaration should return the *argument Declaration* for renaming-as-declaration, and it should return the *corresponding subprogram declaration* for renaming-as-body. Sergey Rybin -------------------- P.S. Clyde, should I send this message as a comment to asis-comment, or this message is enough as sent to ASIS technical? From sblake@alsys.com Thu May 1 09:55:47 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id JAA03981; Thu, 1 May 1997 09:55:47 -0400 Received: from gw.alsys.com by ida.org (4.1/SMI-4.1) id AA00411; Thu, 1 May 97 09:56:19 EDT Received: from rasht.alsys.com (mailhub.alsys.com) by gw.alsys.com (4.1/SMI-4.1.1) id AA08568; Thu, 1 May 97 06:56:35 PDT Received: from puumba.telesoft by rasht.alsys.com (4.1/TS-1.2c) id AA21799; Thu, 1 May 97 06:55:13 PDT Received: by puumba.telesoft (SMI-8.6/SMI-SVR4) id GAA12811; Thu, 1 May 1997 06:55:12 -0700 Date: Thu, 1 May 1997 06:55:12 -0700 From: sblake@alsys.com (Steve Blake @pulsar) Message-Id: <199705011355.GAA12811@puumba.telesoft> To: asis-technical@sw-eng.falls-church.va.us, rybin@possum.srcc.msu.su Subject: Re: renaming-as-body and renaming-as-declaration in ASIS Cc: roby@ida.org Content-Length: 333 Status: OR In either case, renaming as the declaration or body, Corresponding_Declaration should just return the argument (the renaming declaration). This avoids compilcation of this query. This encourages using the proper queries to analyze renaming declarations, which can lead a client back to the original declaration if desired. Steve From alainlg@student.DoCS.UU.SE Tue May 6 10:55:41 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id KAA09371; Tue, 6 May 1997 10:55:41 -0400 Received: from Veda.DoCS.UU.SE by ida.org (4.1/SMI-4.1) id AA10241; Tue, 6 May 97 10:56:11 EDT Received: from Xantia.DoCS.UU.SE (Xantia.DoCS.UU.SE [130.238.8.76]) by Veda.DoCS.UU.SE (8.6.12/8.6.12) with ESMTP id QAA07077; Tue, 6 May 1997 16:55:36 +0200 Received: (alainlg@localhost) by Xantia.DoCS.UU.SE (8.6.12/8.6.12) id QAA26702; Tue, 6 May 1997 16:55:34 +0200 Date: Tue, 6 May 1997 16:55:34 +0200 Message-Id: <199705061455.QAA26702@Xantia.DoCS.UU.SE> From: Alain Le Guennec To: sblake@alsys.com Cc: asis-technical@sw-eng.falls-church.va.us, rybin@possum.srcc.msu.su, roby@ida.org In-Reply-To: <199705011355.GAA12811@puumba.telesoft> (sblake@alsys.com) Subject: Re: renaming-as-body and renaming-as-declaration in ASIS Content-Length: 1149 Status: OR Steve Blake wrote: : In either case, renaming as the declaration or body, Corresponding_Declaration : should just return the argument (the renaming declaration). This avoids : compilcation of this query. This encourages using the proper queries to : analyze renaming declarations, which can lead a client back to the original : declaration if desired. I don't understand why Corresponding_Declaration should not distinguish between body-as-subprogram-declaration and body-as-completion-of-previous-declaration in the case of renamings, whereas it does in case (eg) of body stubs. After all, there are some specific queries to deal with stubs and subunits, as there are some to deal with renamings. Moreover, to go back to the declaration which is completed by a renaming-as-body (which as Sergey suggests could be done by Corresponding_Declaration), I don't see how queries specific to renaming-declarations can help, since they provide information only on the renamed entity, not on the new view. Now I don't see how to get easily from the completion back to the declaration, but I may be missing something obvious. -- Alain Le Guennec. From rybin@possum.srcc.msu.su Tue May 13 14:19:49 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id OAA16008; Tue, 13 May 1997 14:19:48 -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 AA27207; Tue, 13 May 97 14:20:24 EDT Received: from crocus.gamma.ru by sw-eng.falls-church.va.us (8.7.1/) id RAA24272; Tue, 13 May 1997 17:53:10 GMT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id VAA29332; Tue, 13 May 1997 21:55:45 +0400 (MSD) Received: by gamma.srcc.msu.su; Tue, 13 May 1997 21:55:03 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Tue, 13 May 1997 21:52:58 +0400 To: Alain.LeGuennec@enst-bretagne.fr Cc: asis-technical@sw-eng.falls-church.va.us, sblake@alsys.com References: Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Tue, 13 May 97 21:52:58 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: renaming-as-... in ASIS Lines: 89 Content-Length: 4227 Status: OR Alain, I'm sending this message as "Cc:" to Steve and to asis-technical. Some time ago Steve and myself discussed this problem, but - shame on me! - I cannot find this discussion in my mail archive. And I am sure, that here we have a hole in the ASIS defrinition which should be fixed (in any case, independently on who is right - you or me). > > Another thing is that Corresponding_Called_Function and > > Corresponding_Called_Entity both unwind renamings. Does this > > help? > > I think they should NOT, since A_Procedure_Renaming_Declaration > (resp. A_Function_Renaming_Declaration) are part of the possible > returned declaration kinds, in the case of renaming as declaration > (the incomplete declaration should be returned instead in the case > of renaming as body.) Well, let me justify my position. First, the definition of Corresponding_Called_Entity says: "Returns the declaration of the *procedure or entry* denoted by the call". That is, the declaration of some *entity* should be returned. But a renaming declaration *does not* define and *entity*, it defines a new *name* for some *previously declared* *entity*. Second, there is another query in ASIS - Corresponding_Name_Definition, related to *names* but not *entities*. Name can be defined by a renaming declaration, entity - cannot. So Corresponding_Name_Definition does not unwind any renaming. So, if you would like to know, what subprogram or entry *entity* is called - use Corresponding_Caleed_Entity/Corresponding_Called_Function. But if you would like to know the "naming history" (I'm not sure, that this is the best term, but I hope you see, what I mean) - select the prefix from the call, and then analyze it (may be, along with doing some additional decomposition of the prefix) by applying Corresponding_Name_Definition. Third, renaming-as-body makes a somewhat special case for ASIS. From one side, it is a completion of some subprogram declaration, but, formally speaking, any subprogram declaration declares an entity. But from the other side, no *new* subprogram is declared by this declaration. So I would unwind renamings only for a renaming-as-declaration, but not for renaming-as-body. And, finally, I think, that the definition of these two queries: Corresponding_Called_Function and Corresponding_Called_Entity should be clarified. First, it should be said explicitly whether or not unwinding of renamings should take place. Second, if these queries should unwing renamings, A_Procedure_Renaming_Declaration and A_Function_Renaming_Declaration should be removed from the lists of returned kinds. > The declaration of the procedure/function is not the same > as the declaration of the renamed entity, so I think no unwinding > should be done at all (otherwise you could as well go directly > to the proper body instead of returning a body stub for subunits.) > Why not simply return the "real (first)" subprogram declaration ? I think the rule should be - to return the declaration defining the corresponding callable *entity*. > And there are cases (renaming an enumeration literal or an > access dereference as a function for example) where there is > a valid subprogram declaration to return only if you do not unwind. ^^^^^^^^^^^^^^^^^^^^^^ "Subprogram" or *renaming* declaration? But, for sure, you are right - there are cases when it is impossible to return the *declaration* of the called entity, and not all of them are mentioned in the definition of these queries. If you use an access dereference "directly", but not through renaming, you will have the same problem. > Moreover, it may be interesting to know whether a given renaming > is used or not (not only the based entity), for example to get rid > of the "dummy" bodies that GNAT generates for renamings as body. > This is harder to do if you unwind renamings autmatically. I'm afraid, a static code analysis tool has to make difference between the use of subprograms and the use of names to access subprograms. And it has to use Corresponding_Called_Function/Entity for the first kind of analysis, and it has to use Corresponding_Name_Definition as the basis for the second kind of analysis. Sergey From roby Fri May 23 16:30:48 1997 Return-Path: Received: by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id QAA05840; Fri, 23 May 1997 16:27:30 -0400 From: roby (Clyde Roby) Message-Id: <199705232027.QAA05840@cronus.csed.ida.org> Subject: new issue #077 To: alainlg@student.DoCS.UU.SE (Alain Le Guennec), rybin@alex.srcc.msu.su (Rybin), SBlake@Aonix.Com (Steve Blake) Date: Fri, 23 May 1997 16:27:29 -0400 (EDT) Cc: roby (me), ASIS-Officers@SW-Eng.Falls-Church.Va.US (asis-officers) In-Reply-To: <199705061455.QAA26702@Xantia.DoCS.UU.SE> from "Alain Le Guennec" at May 6, 97 04:55:34 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 649 Status: OR All, Sergey recently sent an email message with Subject "renaming-as-body and renaming-as-declaration in ASIS" to ASIS-Technical; this is now Issue #077. Both Steve and Alain have replied to this original email message (dated 28 April); Steve's reply was dated 1 May and Alain's reply was dated 6 May. We have an opportunity to correct this problem if necessary. Please suggest appropriate changes (exact words, if possible) to appropriate interfaces. We need to have this information by COB Tuesday, 27 May, because Currie and Clyde are meeting Wednesday to finalize everything for the 2 June meeting of WG9. Thank you. Clyde (and Currie) From sblake@sd.aonix.com Sun May 25 14:01:21 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id OAA07671; Sun, 25 May 1997 14:01:20 -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 AA11217; Sun, 25 May 97 14:01:59 EDT Received: from gw.alsys.com by sw-eng.falls-church.va.us (8.7.1/) id RAA02567; Sun, 25 May 1997 17:54:40 GMT Received: from rasht.sd.aonix.com (mailhub.alsys.com) by gw.alsys.com (4.1/SMI-4.1.1) id AA03257; Sun, 25 May 97 10:58:08 PDT Received: from puumba.telesoft by rasht.sd.aonix.com (4.1/TS-1.2c) id AA18835; Sun, 25 May 97 10:56:29 PDT Received: by puumba.telesoft (SMI-8.6/SMI-SVR4) id KAA13196; Sun, 25 May 1997 10:56:28 -0700 Date: Sun, 25 May 1997 10:56:28 -0700 From: sblake@sd.aonix.com (Steve Blake @pulsar) Message-Id: <199705251756.KAA13196@puumba.telesoft> To: SBlake@aonix.com, alainlg@Minsk.DoCS.UU.SE, roby@ida.org, rybin@alex.srcc.msu.su Subject: Re: new issue #077 Cc: ASIS-Officers@sw-eng.falls-church.va.us Content-Length: 864 Status: OR > Sergey recently sent an email message with Subject >"renaming-as-body and renaming-as-declaration in ASIS" to >ASIS-Technical; this is now Issue #077. Both Steve and Alain have >replied to this original email message (dated 28 April); Steve's reply >was dated 1 May and Alain's reply was dated 6 May. If I understand the issue correctly, when a renaming-as-body is an argument to Corresponding_Declaration, the subprogram_declaration for which the renaming serves as the completion is returned. A renaming_as_declaration would just return itself, as the current query semantics prescribe. If that is correct, then here is commentary that can be added to Corresponding_Declaration: -- If a renaming-as-body renaming_declaration is given, the specification -- returned is the subprogram_declaration for which the renaming serves as a -- completion. Steve 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 OAA07686; Sun, 25 May 1997 14:12:30 -0400 Received: from crocus.gamma.ru by ida.org (4.1/SMI-4.1) id AA11244; Sun, 25 May 97 14:09:33 EDT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id WAA28386; Sun, 25 May 1997 22:08:43 +0400 (MSD) Received: by gamma.srcc.msu.su; Sun, 25 May 1997 22:08:13 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Sat, 24 May 1997 21:52:20 +0400 To: alainlg@Minsk.DoCS.UU.SE, roby@ida.org, SBlake@Aonix.Com Cc: ASIS-Officers@SW-Eng.Falls-Church.Va.US References: <199705232027.QAA05840@cronus.csed.ida.org> Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Sat, 24 May 97 21:52:19 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: new issue #077 Lines: 126 Content-Length: 5411 Status: OR > All, > > Sergey recently sent an email message with Subject > "renaming-as-body and renaming-as-declaration in ASIS" to > ASIS-Technical; this is now Issue #077. Both Steve and Alain have > replied to this original email message (dated 28 April); Steve's reply > was dated 1 May and Alain's reply was dated 6 May. I still think, that ASIS should make the difference between renaming-as-sdeclaration and renaming-as-body in Asis.Declarations.Corresponding_Declaration. Otherwise (as it stands now) ASIS does not give any natural means to go from renaminmg-as-body to the subprogram declaration for which this renaming-as-body is a completion. Below is my suggestion for changing the definition of Asis.Declarations.Corresponding_Declaration. Sergey. --------------------------------------------------------------------------------------- -- Subclause 15.26 function Corresponding_Declaration --------------------------------------------------------------------------------------- function Corresponding_Declaration (Declaration : in Asis.Declaration) return Asis.Declaration; function Corresponding_Declaration (Declaration : in Asis.Declaration; The_Context : in Asis.Context) return Asis.Declaration; --------------------------------------------------------------------------------------- -- Declaration - Specifies the specification to query -- The_Context - Specifies a Context to use -- -- Returns the corresponding specification of a subprogram, package, or task -- body declaration. Returns the expanded generic specification template for -- generic instantiations. The argument can be a Unit_Declaration from a -- Compilation_Unit, or, it can be any appropriate body declaration from any -- declarative context. -- -- These two function calls will always produce identical results: -- -- Decl2 := Corresponding_Declaration (Decl1); -- Decl2 := Corresponding_Declaration -- (Decl1, -- Enclosing_Context( Enclosing_Compilation_Unit( Decl1 ))); -- -- If a specification declaration is given, the same element is returned, -- unless it is a generic instantiation or an inherited subprogram declaration -- (see below). -- -- If a subprogram renaming declaration is given, the same element is returned -- in case of renaming-as-declaration, and the subprogram declaration -- completed by this subprogram renaming declaration is returned in case -- (RM95, 8.5.4(1)) of renaming-as-body -- -- Returns a Nil_Element if no explicit specification exists, or the -- declaration is the proper body of a subunit. -- -- The parameter The_Context is used to locate the corresponding specification -- within a particular Context. The_Context need not be the Enclosing_Context -- of the Declaration. Any non-Nil result will always have The_Context -- as its Enclosing_Context. This implies that while a non-Nil result may be -- Is_Equal with the argument, it will only be Is_Identical if the -- Enclosing_Context of the Declaration is the same as the parameter -- The_Context. -- -- If a generic instantiation is given, the expanded generic specification -- template representing the instance is returned and Is_Part_Of_Instance. -- For example, an argument that is A_Package_Instantiation, results in a -- value that is A_Package_Declaration that can be analyzed with all -- appropriate queries. -- -- The Enclosing_Element of the expanded specification is the generic -- instantiation. The Enclosing_Compilation_Unit of the expanded template is -- that of the instantiation. -- -- If an inherited subprogram declaration is given, the specification -- returned is the one for the user-defined subprogram from which the -- argument was ultimately inherited. -- -- Appropriate Declaration_Kinds returning a specification: -- A_Function_Body_Declaration -- A_Function_Renaming_Declaration (renaming-as-body) -- A_Function_Body_Stub -- A_Function_Instantiation -- A_Package_Body_Declaration -- A_Package_Body_Stub -- A_Package_Instantiation -- A_Procedure_Body_Declaration -- A_Procedure_Renaming_Declaration (renaming-as-body) -- A_Procedure_Body_Stub -- A_Procedure_Instantiation -- A_Task_Body_Declaration -- A_Task_Body_Stub -- -- Appropriate Declaration_Kinds returning the argument Declaration: -- A_Function_Declaration -- A_Function_Renaming_Declaration (renaming-as-declaration) -- A_Generic_Function_Declaration -- A_Generic_Package_Declaration -- A_Generic_Procedure_Declaration -- A_Package_Declaration -- A_Package_Renaming_Declaration -- A_Procedure_Declaration -- A_Procedure_Renaming_Declaration (renaming-as-declaration) -- A_Single_Task_Declaration -- A_Task_Type_Declaration -- -- Returns Declaration_Kinds: -- Not_A_Declaration -- A_Function_Declaration -- A_Function_Renaming_Declaration -- A_Generic_Function_Declaration -- A_Generic_Package_Declaration -- A_Generic_Procedure_Declaration -- A_Package_Declaration -- A_Package_Renaming_Declaration -- A_Procedure_Declaration -- A_Procedure_Renaming_Declaration -- A_Single_Task_Declaration -- A_Task_Type_Declaration -- --------------------------------------------------------------------------------------- From sblake@sd.aonix.com Sun May 25 15:10:05 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id PAA07724; Sun, 25 May 1997 15:10:04 -0400 Received: from gw.alsys.com by ida.org (4.1/SMI-4.1) id AA11539; Sun, 25 May 97 15:10:44 EDT Received: from rasht.sd.aonix.com (mailhub.alsys.com) by gw.alsys.com (4.1/SMI-4.1.1) id AA03392; Sun, 25 May 97 11:51:34 PDT Received: from puumba.telesoft by rasht.sd.aonix.com (4.1/TS-1.2c) id AA19670; Sun, 25 May 97 11:49:56 PDT Received: by puumba.telesoft (SMI-8.6/SMI-SVR4) id LAA14775; Sun, 25 May 1997 11:49:55 -0700 Date: Sun, 25 May 1997 11:49:55 -0700 From: sblake@sd.aonix.com (Steve Blake @pulsar) Message-Id: <199705251849.LAA14775@puumba.telesoft> To: SBlake@aonix.com, alainlg@Minsk.DoCS.UU.SE, roby@ida.org, rybin@possum.srcc.msu.su Subject: Re: new issue #077 Cc: ASIS-Officers@sw-eng.falls-church.va.us Content-Length: 185 Status: OR Sergey and I sent replies to this at nearly the same time, half way across the world from each other (hmmm...). I like Sergey's wording better than mine, and suggest we use it. Steve