From rybin@possum.srcc.msu.su Thu Oct 16 10:52:52 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id KAA28388; Thu, 16 Oct 1997 10:52:51 -0400 Received: from mail.acm.org by ida.org (4.1/SMI-4.1) id AA29008; Thu, 16 Oct 97 10:54:01 EDT Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us [199.75.54.2]) by mail.acm.org (8.8.5/8.7.5) with ESMTP id KAA121008; Thu, 16 Oct 1997 10:57:38 -0400 Received: from wormhole.mtc.iitri.com by sw-eng.falls-church.va.us (8.7.1/) id OAA15301; Thu, 16 Oct 1997 14:49:19 GMT Received: from crocus.gamma.ru ([193.124.255.1]) by mtc.iitri.com (4.1/3.1.090690-IITRI-MTC) id AA17475; Thu, 16 Oct 97 10:55:34 EDT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id SAA02526; Thu, 16 Oct 1997 18:49:50 +0400 (MSD) Received: by gamma.srcc.msu.su; Thu, 16 Oct 1997 18:48:47 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Thu, 16 Oct 1997 18:45:04 +0300 To: asis-comment@sw-eng.falls-church.va.us Cc: Alain.Le_Guennec@irisa.fr, asis-officers@sw-eng.falls-church.va.us Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Thu, 16 Oct 97 18:45:04 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Normalized generic association questions Lines: 81 Content-Length: 3730 Status: OR The latest ASIS draft does not contain the instructions for comment submission (by the way, why?), so I'm preparing this message in some "free" format, and I'm sending it also to asis-officers, because I'm not sure that asis-comment is still valid (And because of the communication problems I'm not able to check the ASIS Pages till tomorrow afternoon). I have two questions concerning the normalized generic associations. May be, it would be better to send two separate messages, but all the preliminary explanations needed to ask these questions are the same. So, consider the following piece of the Ada code: procedure Test is -- 1 type T is range -100 .. 100; -- 2 procedure Deault_Proc (I : Integer) is -- 3 begin -- 4 null; -- 5 end Deault_Proc; -- 6 -- 7 generic -- 8 type Form_T is range <>; -- 9 with procedure Form_Proc (I : Integer) is Deault_Proc; --10 with function "+" (L, R : T) return T is <>; --11 package Gen_Pack is --12 end Gen_Pack; --13 --14 package Inst_Pack is new Gen_Pack (T); --15 begin --16 null; --17 end Test; --18 Let's get the Generic_Actual_Part from the insatntiation in the line 15 with Normalized => True, and let's decompose further the second component of the result (which gives an example of well-defined situation) and the third components of the results (which raises questions). First, what do we have as a result of Generic_Actual_Part? It should look like: (Form_T => T, Form_Proc => Default_Proc, "+" => ??? --<-- and what should be here ??) Now, let's apply Actual_Parameter. For the second component we should get the name (expression) Default_Proc from the line 10, and its Enclosing_Element should be the corresponding A_Formal_Procedure_Declaration element, just as explained in the definition of Asis.Expressions.Actual_Parameter for normalized generic associations. Right? Fine! And now let's apply Actual_Parameter to the third association. And here are two questions: QUESTION 1: What *should* happen, if an ASIS implementation does not support the implicit predefined operations? Should we get Nil_Element? I think, this is the only reasonable interpretation. If so, it should be stated in the documentation. QUESTION 2: Suppose we have a "good" implementation, which does support implicit predefined operations (in fact, this even is not important, we can just add the explicit declaration of the "+" function for T in this example). What should be returned by Actual_Parameter? Should it be the declaration of the (explicit or implicit) declaration of the corresponding "+" function? But Actual_Parameter can return only An_Expression results. We do not have any (naming) expression representing this "+" function at all in this example, but we have a normalized generic association with this "+" as an actual. And what should be an Enclosing_Element for the result? I myself do not have any clear idea how the answer the second question. Any comments? Sergey Rybin. From rybin@possum.srcc.msu.su Fri Oct 17 05:06:41 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id FAA29745; Fri, 17 Oct 1997 05:06:41 -0400 Received: from mail.acm.org by ida.org (4.1/SMI-4.1) id AA15654; Fri, 17 Oct 97 05:07:44 EDT Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us [199.75.54.2]) by mail.acm.org (8.8.5/8.7.5) with ESMTP id FAA102398; Fri, 17 Oct 1997 05:11:36 -0400 Received: from crocus.gamma.ru by sw-eng.falls-church.va.us (8.7.1/) id JAA19192; Fri, 17 Oct 1997 09:00:40 GMT Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id NAA14402; Fri, 17 Oct 1997 13:03:33 +0400 (MSD) Received: by gamma.srcc.msu.su; Fri, 17 Oct 1997 13:02:15 +0400 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Fri, 17 Oct 1997 12:15:58 +0300 To: asis-comment@sw-eng.falls-church.va.us Cc: asis-officers@sw-eng.falls-church.va.us, leguennec@act-europe.fr References: Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Fri, 17 Oct 97 12:15:58 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: Normalized generic association questions Lines: 71 Content-Length: 3543 Status: OR We've discussed the problem of normalized generic associations with Alain Le Guennec (the question itself arose when Alain asked me to implement normalized generic associations for GNAT, because he needed them for the tool he worked on). Below is some ideas how to fix this hole in the current ASIS 95 definition. 1. Asis.Declarations.Generic_Actual_Part and Asis.Expressions.Actual_Parameter require clarification for the situation of the normalized generic association in case if the corresponding A_Formal_Procedure_Declaration Element has defaults of A_Box_Default kind. 2. The general idea is to return an *implicit* naming expression as an actual parameter part of the normalized generic association, and this *implicit* naming expression should denote the actual procedure passed as default. 3. Asis.Expressions.Actual_Parameter for such a normalized association should return this naming expression, and it should be Is_Part_Of_Implicit. This naming expression should be returned also in case if the actual is an implicitly declared predefined operation, whether or not an ASIS implementation supports implicit predefined operations. By applying Corresponding_Name_Definition to this implicit naming expression, an application can get to know, what is an actual subprogram chosen as default for this A_Box_Default. This information is really important for an application, therefore it should be a way to get it easily, without going through all the Ada visibility rules. And returning something like a box (if we would follow the common rule for defaults in ASIS - to go to the place where this default is defined) would give nothing, because, as RM 95 12.6 (15) says, A default_name denotes an entity that is visible or directly visible at the place of the generic_declaration; a box used as a default is equivalent to a name that denotes an entity that is directly visible at the place of the _instantiation. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If an ASIS implementation does not support implicit predefined operations, it should return the corresponding operator sign as an actual parameter for such an normalized association, but it will return Nil_Element if we ask for the definition of this operator sign (by applying Corresponding_Name_Definition). 4. The last question is - what should be Enclosing_Element for such an implicit naming expression. For me it is not clear now. Three alternatives may be considered: (1) The definition of the corresponding formal subprogram having A_Box_Default. The only advantage of this solution is that it would follow the general approach for defaulted associations. But such an Enclosing_Element would have nothing in common with the actual semantic of such a default actual subprogram chosen at the place of *instantiation*. (2) The corresponding *normalized* generic association. It would correspond to the semantic of such a default actual parameter, but it would introduce the special case for Enclosing_Element, when an artificial construct would be returned by it. (3) Nil_Element. It's simple, and in some sense it reflects the situation - everything is artificial - an artificial association, an artificial implicit naming expression in it... Do we really need an Enclosing_Element for such a naming expression? Waiting for your comments, Sergey From dewar@gnat.com Fri Oct 17 08:10:24 1997 Return-Path: Received: from ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id IAA29847; Fri, 17 Oct 1997 08:10:24 -0400 Received: from mail.acm.org by ida.org (4.1/SMI-4.1) id AA16910; Fri, 17 Oct 97 08:11:35 EDT Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us [199.75.54.2]) by mail.acm.org (8.8.5/8.7.5) with ESMTP id IAA46498; Fri, 17 Oct 1997 08:15:28 -0400 Received: from nile.gnat.com by sw-eng.falls-church.va.us (8.7.1/) id MAA24839; Fri, 17 Oct 1997 12:05:17 GMT Received: by nile.gnat.com (5.0/1.20) id AA07395; Fri, 17 Oct 97 08:05:12 EDT Date: Fri, 17 Oct 97 08:05:12 EDT From: dewar@gnat.com (Robert Dewar) Message-Id: <9710171205.AA07395@nile.gnat.com> To: asis-comment@sw-eng.falls-church.va.us, rybin@possum.srcc.msu.su Subject: Re: Normalized generic association questions Cc: asis-officers@sw-eng.falls-church.va.us, leguennec@act-europe.fr Content-Length: 185 Status: OR This seems a significant hole, one that needs to be addressed before standardization is complete (I am still concerned that standardization is being rushed ahead prematurely for ASIS). From roby Tue Dec 9 14:44:41 1997 Return-Path: Received: by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id OAA06235; Tue, 9 Dec 1997 14:44:39 -0500 From: roby (Clyde Roby) Message-Id: <199712091944.OAA06235@cronus.csed.ida.org> Subject: Re: Normalized generic association questions To: rybin@alex.srcc.msu.su (Rybin) Date: Tue, 9 Dec 1997 14:44:38 -0500 (EST) Cc: roby (me), Colket@ACM.Org (Currie Colket) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 4981 Status: OR Sergey, Regarding the following email message you sent concerning normalized generic association questions, what specific changes would you like to see made to the text for the following interfaces? 15.45 Asis.Declarations.Generic_Actual_Part, 17.22 Asis.Expressions.Actual_Parameter, 13.33 Asis.Elements.Is_Part_of_Implicit, 13.36 Asis.Elements.Enclosing_Elements, and 17.6 Asis.Expressions.Corresponding_Name_Definition. Also, you do not need to send the entire section back to us, only the changes. In this email message, you suggested 3 alternatives (for the 4th idea) for an impliciit naming expression which may be considered. Which alternative have you implemented in ASIS-for-GNAT? We are about to propose a recommended solution with your guidance. Note that your issue is now ASIS Issue #083; you can access this information on the ASIS web site. Thank you. Clyde and Currie Forwarded message: From rybin@possum.srcc.msu.su Fri Oct 17 05:06:41 1997 To: asis-comment@sw-eng.falls-church.va.us Cc: asis-officers@sw-eng.falls-church.va.us, leguennec@act-europe.fr References: Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Fri, 17 Oct 97 12:15:58 +0400 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: Normalized generic association questions Lines: 71 Content-Length: 3543 We've discussed the problem of normalized generic associations with Alain Le Guennec (the question itself arose when Alain asked me to implement normalized generic associations for GNAT, because he needed them for the tool he worked on). Below is some ideas how to fix this hole in the current ASIS 95 definition. 1. Asis.Declarations.Generic_Actual_Part and Asis.Expressions.Actual_Parameter require clarification for the situation of the normalized generic association in case if the corresponding A_Formal_Procedure_Declaration Element has defaults of A_Box_Default kind. 2. The general idea is to return an *implicit* naming expression as an actual parameter part of the normalized generic association, and this *implicit* naming expression should denote the actual procedure passed as default. 3. Asis.Expressions.Actual_Parameter for such a normalized association should return this naming expression, and it should be Is_Part_Of_Implicit. This naming expression should be returned also in case if the actual is an implicitly declared predefined operation, whether or not an ASIS implementation supports implicit predefined operations. By applying Corresponding_Name_Definition to this implicit naming expression, an application can get to know, what is an actual subprogram chosen as default for this A_Box_Default. This information is really important for an application, therefore it should be a way to get it easily, without going through all the Ada visibility rules. And returning something like a box (if we would follow the common rule for defaults in ASIS - to go to the place where this default is defined) would give nothing, because, as RM 95 12.6 (15) says, A default_name denotes an entity that is visible or directly visible at the place of the generic_declaration; a box used as a default is equivalent to a name that denotes an entity that is directly visible at the place of the _instantiation. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If an ASIS implementation does not support implicit predefined operations, it should return the corresponding operator sign as an actual parameter for such an normalized association, but it will return Nil_Element if we ask for the definition of this operator sign (by applying Corresponding_Name_Definition). 4. The last question is - what should be Enclosing_Element for such an implicit naming expression. For me it is not clear now. Three alternatives may be considered: (1) The definition of the corresponding formal subprogram having A_Box_Default. The only advantage of this solution is that it would follow the general approach for defaulted associations. But such an Enclosing_Element would have nothing in common with the actual semantic of such a default actual subprogram chosen at the place of *instantiation*. (2) The corresponding *normalized* generic association. It would correspond to the semantic of such a default actual parameter, but it would introduce the special case for Enclosing_Element, when an artificial construct would be returned by it. (3) Nil_Element. It's simple, and in some sense it reflects the situation - everything is artificial - an artificial association, an artificial implicit naming expression in it... Do we really need an Enclosing_Element for such a naming expression? Waiting for your comments, Sergey From rybin@possum.srcc.msu.su Wed Dec 17 12:59:45 1997 Return-Path: Received: from cs.ida.org by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id MAA11417; Wed, 17 Dec 1997 12:59:39 -0500 Received: from crocus.gamma.ru (crocus.gamma.ru [193.124.255.1]) by cs.ida.org (8.8.7/8.8.7) with ESMTP id NAA00581 for ; Wed, 17 Dec 1997 13:00:41 -0500 (EST) Received: from srcc.UUCP (uucp@localhost) by crocus.gamma.ru (8.8.5/8.7.3) with UUCP id UAA15622; Wed, 17 Dec 1997 20:59:51 +0300 (MSK) Received: by gamma.srcc.msu.su; Wed, 17 Dec 1997 20:58:48 +0300 Received: by possum.srcc.msu.su (UUPC/@ v5.09gamma, 14Mar93); Wed, 17 Dec 1997 20:58:23 +0300 To: roby@ida.org Cc: Alain.Le_Guennec@irisa.fr, Colket@ACM.Org References: <199712091944.OAA06235@cronus.csed.ida.org> Message-Id: Organization: Information Systems, SRCC, MSU From: "Sergey I. Rybin" Date: Wed, 17 Dec 97 20:58:23 +0300 X-Mailer: BML [MS/DOS Beauty Mail v.1.36] Subject: Re: Normalized generic association questions Lines: 106 Content-Length: 5011 Status: OR First of all, sorry for the delay with this reply :) Second, I'm sending this message also to Alain - may be, he will add some comments based on his experience. > Regarding the following email message you sent concerning > normalized generic association questions, what specific changes would > you like to see made to the text for the following interfaces? > > 15.45 Asis.Declarations.Generic_Actual_Part, I would replace : -- Each normalized association represents a one on one mapping of a -- generic_formal_parameter_declaration to the explicit or default expression -- or name. A normalized association has one A_Defining_Name component that -- denotes the generic_formal_parameter_declaration, and one An_Expression -- component that is either the explicit_generic_actual_parameter, or a -- default_expression or default_name. by -- Each normalized association represents a one on one mapping of a -- generic_formal_parameter_declaration to the explicit or default expression -- or name. A normalized association has one A_Defining_Name component that -- denotes the generic_formal_parameter_declaration, and one An_Expression -- component that is either the explicit_generic_actual_parameter, a -- default_expression or a default_name from the -- generic_formal_parameter_declaration, or an implicit naming expression -- which denotes the actual subrogram selected at place of instantiation for -- a formal subprogram having A_Box_Default. > 17.22 Asis.Expressions.Actual_Parameter, I would correct: -- - The Enclosing_Element of the An_Expression element is the -- parameter_specification or generic_formal_parameter_declaration that -- contains the default_expression or default_name. as: -- - The Enclosing_Element of the An_Expression element is the -- parameter_specification or generic_formal_parameter_declaration that -- contains the default_expression or default_name, except for the case when -- this An_Expression element is an implicit naming expression -- representing the actual subprogram selected at place of the -- instantiation for A_Box_Default. In the latter case the Enclosing_Element -- for such An_Expression is the instantiation. > 13.33 Asis.Elements.Is_Part_of_Implicit, I would correct: -- Reference Manual 6.4(9) - Implicit actual parameter expressions (defaults). -- - The A_Parameter_Association that includes a defaulted -- parameter value Is_Normalized and also -- Is_Part_Of_Implicit. The Formal_Parameter and the -- Actual_Parameter values from such Associations are not -- Is_Part_Of_Implicit unless they are from default -- initializations for an inherited subprogram declaration -- and have an Enclosing_Element that is the parameter -- specification of the subprogram declaration. (Those -- elements are shared with (were created by) the original -- subprogram declaration.) as: -- Reference Manual 6.4(9) - Implicit actual parameter expressions (defaults). -- 12.3(7) - The A_Parameter_Association that includes a defaulted -- parameter value Is_Normalized and also -- Is_Part_Of_Implicit. The Formal_Parameter and the -- Actual_Parameter values from such Associations are not -- Is_Part_Of_Implicit unless they are from default -- initializations for an inherited subprogram declaration -- and have an Enclosing_Element that is the parameter -- specification of the subprogram declaration. (Those -- elements are shared with (were created by) the original -- subprogram declaration.), or they are naming -- expressions representing the actual generic -- subprogram selected at place of an instantiation for -- A_Box_Default. > 13.36 Asis.Elements.Enclosing_Elements, No change is needed. > 17.6 Asis.Expressions.Corresponding_Name_Definition. No change is needed. > > Also, you do not need to send the entire section back to us, > only the changes. > > In this email message, you suggested 3 alternatives (for the > 4th idea) for an impliciit naming expression which may be considered. > Which alternative have you implemented in ASIS-for-GNAT? We are about > to propose a recommended solution with your guidance. My proposals in this message corresppond to what I implemented for GNAT (or to what I tried to implement :) Sergey From roby Wed Jan 7 15:46:46 1998 Return-Path: Received: by cronus.csed.ida.org (SMI-8.6/SMI-SVR4) id PAA17333; Wed, 7 Jan 1998 15:46:40 -0500 From: roby (Clyde Roby) Message-Id: <199801072046.PAA17333@cronus.csed.ida.org> Subject: Issue #083, Normalized generic association questions To: ASIS-Technical@SW-Eng.Falls-Church.Va.US (ASIS-Technical) Date: Wed, 7 Jan 1998 15:46:40 -0500 (EST) Cc: roby (me), Colket@ACM.Org (Currie Colket), rybin@alex.srcc.msu.su (Rybin) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 4690 Status: OR ASIS-Technical, In reference to Issue #083, Normalized generic association questions (http://www.acm.org/sigada/wg/asiswg/issues/issue083.i), the attached solution is proposed. Please review this solution and identify any additional changes you think are necessary or any alternative solutions, and send them to ASIS-Technical. Clyde and Currie ------- For clause 15.45, Asis.Declarations.Generic_Actual_Part, replace: -- Each normalized association represents a one on one mapping of a -- generic_formal_parameter_declaration to the explicit or default expression -- or name. A normalized association has one A_Defining_Name component that -- denotes the generic_formal_parameter_declaration, and one An_Expression -- component that is either the explicit_generic_actual_parameter, or a -- default_expression or default_name. with: -- Each normalized association represents a one-on-one mapping of a -- generic_formal_parameter_declaration to the explicit or default expression -- or name. A normalized association has: -- - one A_Defining_Name component that denotes the -- generic_formal_parameter_declaration, and -- - one An_Expression component that is either: -- o the explicit_generic_actual_parameter, -- o a default_expression, or -- o a default_name from the generic_formal_parameter_declaration or -- an implicit naming expression which denotes the actual subprogram -- selected at the place of instantiation for a formal subprogram -- having A_Box_Default. For clause 17.22, Asis.Expressions.Actual_Parameter, correct: -- - The Enclosing_Element of the An_Expression element is the -- parameter_specification or generic_formal_parameter_declaration that -- contains the default_expression or default_name. to: -- - The Enclosing_Element of the An_Expression element is the -- parameter_specification or generic_formal_parameter_declaration that -- contains the default_expression or default_name, except for the case when -- this An_Expression element is an implicit naming expression -- representing the actual subprogram selected at the place of the -- instantiation for A_Box_Default. In the latter case, the Enclosing_Element -- for such An_Expression is the instantiation. For clause 13.33, Asis.Elements.Is_Part_of_Implicit, correct: -- Reference Manual 6.4(9) - Implicit actual parameter expressions (defaults). -- - The A_Parameter_Association that includes a defaulted -- parameter value Is_Normalized and also -- Is_Part_Of_Implicit. The Formal_Parameter and the -- Actual_Parameter values from such Associations are not -- Is_Part_Of_Implicit unless they are from default -- initializations for an inherited subprogram declaration -- and have an Enclosing_Element that is the parameter -- specification of the subprogram declaration. (Those -- elements are shared with (were created by) the original -- subprogram declaration.) -- - All A_Parameter_Association Kinds from a Normalized -- list are Is_Part_Of_Implicit. to: -- Reference Manual 6.4(9) - Implicit actual parameter expressions (defaults). -- and 12.3(7) - The A_Parameter_Association that includes a defaulted -- parameter value Is_Normalized and also -- Is_Part_Of_Implicit. The Formal_Parameter and the -- Actual_Parameter values from such Associations are not -- Is_Part_Of_Implicit unless they are from default -- initializations for an inherited subprogram declaration -- and have an Enclosing_Element that is the parameter -- specification of the subprogram declaration. (Those -- elements are shared with (were created by) the original -- subprogram declaration, or they are naming -- expressions representing the actual generic -- subprogram selected at the place of an instantiation for -- A_Box_Default.) -- - All A_Parameter_Association Kinds from a Normalized -- list are Is_Part_Of_Implicit. -------