CVS difference for ai22s/ai22-0051-1.html

Differences between 1.3 and version 1.4
Log of other versions for file ai22s/ai22-0051-1.html

--- ai22s/ai22-0051-1.html	2023/03/23 07:47:03	1.3
+++ ai22s/ai22-0051-1.html	2023/05/27 07:11:57	1.4
@@ -1,4 +1,4 @@
-<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0051-1/03</title>
+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0051-1/04</title>
 <style type="text/css">
 ol.lst-kix_fognbq43wb1d-1.start{counter-reset:lst-ctn-kix_fognbq43wb1d-1 0}
 .lst-kix_fognbq43wb1d-1>li{counter-increment:lst-ctn-kix_fognbq43wb1d-1}
@@ -24,9 +24,7 @@
 H2.head{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:12pt; color:#000000; font-size:14pt; padding-bottom:6pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; page-break-after:avoid; orphans:2; widows:2; tex
t-align:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.inst{margin-bottom:0; margin-top:0; margin-left:18pt; margin-right:0; padding-top:9pt; color:#000000; font-size:12pt; padding-bottom:6pt; font-family:"Arial","Liberation Sans",sans-serif;line-height:1.15; orphans:2; widows:2; text-align:left; font-weigh
t:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.word{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:3pt; font-family:"Times New Roman","Times",serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:40
0; text-decoration:none; vertical-align:baseline; font-style:normal}
-P.wrds{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:12pt; font-family:"Times New Roman","Times",serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:4
00; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.cbin{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-left:4pt; padding-top:4pt; color:#000000; font-size:10pt; padding-bottom:4pt; font-family:"Courier New",monospace; line-height:1.15; text-align:left; background-color:#f0f0f0;
 font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
-P.btxt{margin-bottom:6pt; margin-top:6pt; margin-left:6pt; margin-right:6pt; padding-top:4pt; color:#000000; font-size:11pt; padding-bottom:4pt; padding-left:4pt; color:#000000; padding-right:4pt; border:1px solid black; font-family:"Arial","Liberation Sa
ns",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.text{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:0pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration:
none; vertical-align:baseline; font-style:normal}
 P.txts{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:11pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration
:none; vertical-align:baseline; font-style:normal}
 UL.bull{margin-bottom:0; margin-top:0; margin-left:12pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:3pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15;text-align:left; font-weight:400; text-decorati
on:none; vertical-align:baseline; font-style:normal; list-style: disc outside}
@@ -34,12 +32,12 @@
 UL.buli{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:3pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15;text-align:left; font-weight:400; text-decorati
on:none; vertical-align:baseline; font-style:normal; list-style: disc outside}
 P.l3h{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0;color:#000000;font-size:26pt;font-family:"Arial","Liberation Sans",sans-serif; padding-top:0pt; padding-bottom:3pt; line-height:1.15; page-break-after:avoid; orphans:2; widows:2; text-alig
n:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 SPAN.p6s{background-color:#fffff0; font-size:9.5pt; font-family:"Times New Roman","Times",serif}
-SPAN.so7{background-color:#fffff0; font-size:9.5pt; font-family:"Times New Roman","Times",serif; font-style:italic}
+SPAN.so7{background-color:#fffff0; font-size:9.5pt; font-family:"Times New Roman","Times",serif;font-style:italic}
 SPAN.nwo{font-family:"Courier New"}
 </style>
 </head><body class="body"><p class="l3h">AI22-0051-1</p>
 <p class="head">!standard 7.3.3(7/5) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;23-03-23 &nbsp;AI22-0051-1/03</p>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;23-05-19 &nbsp;AI22-0051-1/04</p>
 <p class="head">!standard 10.2.1(5)</p>
 <p class="head">!standard 10.2.1(7/5)</p>
 <p class="head">!class Binding Interpretation 22-10-26</p>
@@ -50,33 +48,29 @@
 <p class="head">!qualifier Omission</p>
 <p class="head">!subject Preelaborable_Initialization and contract aspects</p>
 <h2 class="head">!summary</h2>
-<p class="text">*** TBD.</p>
+<p class="text">We ignore the four assertion-ish checks that might be performed as part of default
+initialization (Default_Initial_Condition, Type_Invariant, Static_Prediate, and Dynamic_Predicate)
+when deciding whether something is preelaborable, and then permit implementations to either omit
+the checks, or defer them.</p>
 <h2 class="head">!issue</h2>
-
-<p class="txts">A Default_Initial_Condition expression is evaluated when a default-initialized
-object is created. The aspect Preelaborable_Initialization (P_I) does not take into account any
-such evaluation when it determines whether a component has P_I. That means that such an evaluation
-could execute operations not otherwise allowed during the elaboration of a preelaborated package
-(in particular, calling a function other than the handful allowed for preelaboration). This seems
-to circumvent the purpose of aspect P_I.</p>
-
+<p class="text">A Default_Initial_Condition (D_I_C) expression is evaluated when a
+default-initialized object is created. The aspect Preelaborable_Initialization (P_I) does not take
+into account any such evaluation when it determines whether a component has P_I. That means that
+such an evaluation could execute operations not otherwise allowed during the elaboration of a
+preelaborated package (in particular, calling a function other than the handful allowed for
+preelaboration). This seems to circumvent the purpose of aspect P_I.</p>
 <h2 class="head">!recommendation</h2>
-<p class="txts">*** TBD.</p>
-
+<p class="text">(See Summary.)</p>
 <h2 class="head">!wording</h2>
-<p class="text">*** TBD.</p>
 <p class="inst">Add after 10.2.1(9.1 /5):</p>
-<p class="wrds">For the purposes of the above rules, checks associated with the aspects
+<p class="word">For the purposes of the above rules, checks associated with the aspects
 Default_Initial_Condition, Type_Invariant, Static_Predicate, or Dynamic_Predicate are ignored.</p>
-
 <p class="inst">Add after 10.2.1(11.8 /5):</p>
 <p class="word">Implementation Permissions</p>
-<p class="wrds">Any checks associated with the aspects Default_Initial_Condition, Type_Invariant,
+<p class="word">Any checks associated with the aspects Default_Initial_Condition, Type_Invariant,
 Static_Predicate, or Dynamic_Predicate that would normally accompany the elaboration of a construct
-that is part of a preelaborated unit, may be suppressed completely, or deferred until the beginning
-of the elaboration of the first library unit that is not
-preelaborated.<sup><a href="#cmnt1" name="cmnt_ref1">[a]</a></sup></p>
-
+that is part of a preelaborated unit, may be omitted completely, or deferred until the beginning of
+the elaboration of the first library unit that is not preelaborated.</p>
 <h2 class="head">!discussion</h2>
 <p class="txts">This problem occurs in a number of cases, not just Default_Initial_Condition.</p>
 
@@ -106,7 +100,7 @@
 happens afterward.</p>
 
 <p class="text">&mdash;-</p>
-<p class="text">Possible Solutions:</p>
+<p class="text">Various solutions were considered:</p>
 <ul class="bull"><li>Allow execution;</li>
 </ul>
 <ul class="buli"><li>The last half of 10.2.1 (1.a) [AARM] says &ldquo;<span class="so7">Some
@@ -139,18 +133,22 @@
 <ul class="blts"><li>Disallow P_I and D_I_C together;</li>
 <li>Ignore D_I_C in preelaborable situations, using it as a hint for SPARK proof;</li>
 <li>Defer evaluation/check until the same point a TASK would begin executing. (That is at the
-<span class="nwo">BEGIN</span> associated with the most enclosing
-declarative-region.)<sup><a href="#cmnt2" name="cmnt_ref2">[b]</a></sup></li>
+<span class="nwo">BEGIN</span> associated with the most enclosing declarative-region.)</li>
 </ul>
 
+<p class="txts">We have adopted a combination of the final two bullets, though we do not require
+the check to be deferred. It can be omitted, deferred, or performed at the usual time, if that does
+not interfere with other requirements of preelaboration.</p>
 
 <p class="txts">----</p>
 
 <p class="text">Note that the simple solution of not allowing a type that runs afoul of any of
 these cases to have Preelaborable_Initialization would make it impossible to have a preelaborable
-package that uses Default_Initial_Condition (D_I_C). A D_I_C is only allowed on a private type, and
-as such, any useful D_I_C necessarily has to make at least one function call to query the state of
-the object. So we need a more complex solution (perhaps singling out D_I_C for special rules).</p>
+package that uses Default_Initial_Condition. A D_I_C is only allowed on a private type, and as
+such, any useful D_I_C necessarily has to make at least one function call to query the state of the
+object. So we have adopted the proposal to ignore these assertion-ish checks to determine whether a
+type has preelaborable initialization, and allow implementations to omit or defer the associated
+checks.</p>
 <h2 class="head">!example</h2>
 <p class="txts">The Ada.Containers packages illustrate this issue nicely. Following is the
 specification of the Ada.Containers.Vectors package, showing just the parts relevant to this
@@ -166,14 +164,23 @@
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Length (Vector) = 0 <b>and</b> <b>then
 ...</b>,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Preelaborable_Initialization;</p>
-<p class="text">The elaboration of a default-initialized Vector object will finish with the
+<p class="txts">The elaboration of a default-initialized Vector object will finish with the
 evaluation of the Default_Initial_Condition expression. That will call the function Length.
 However, that means that such an elaborable construct is not preelaborable by the rules given in
 10.2.1(5, 7). Yet we are asserting that this construct is preelaborable by the use of the P_I
 aspect.</p>
+
+<p class="text">With the new rules, the Vector type can have both preelaborable initialization and
+a D_I_C aspect. The implementation need not enforce the D_I_C check when it would interfere with
+preelaboration.</p>
 <h2 class="head">!ACATS test</h2>
-<p class="text">*** TBD. We&rsquo;ll need tests for whatever rule is adopted, but we need to decide
-on a rule before we can say what kind of tests are needed.</p>
+<p class="text">There should be an ACATS C-Test to verify that D_I_C and other similar aspects are
+<i>not</i> considered when deciding whether a type can have a Preelaborable_Initialization aspect.
+There also should be an ACATS C-Test that in a case where an object of such a type is declared
+<i>other than</i> in a preelaborated package, D_I_C, Type_Invariant, etc. are in fact checked. The
+ACATS generally does not test Implementation Permissions, and it would be difficult to test the
+effect of the permission in a preelaborated package anyway, so no test for that case is
+recommended..</p>
 <h2 class="head">!appendix</h2>
 <p class="txts">This AI was promoted from AI12-0420-1, which was put into the Hold state as it was
 reported too late to find a solution in time to make the deadline for Ada 2022. This AI is
@@ -182,15 +189,4 @@
 
 <p class="txts">********************************************************************************</p>
 
-<p class="btxt"><a href="#cmnt_ref1" name="cmnt1">[a]</a>This is the wording that Tucker is
-proposing. (For some reason, when I accepted the change, his comment to that effect disappeared,
-and if I don&#39;t accept the change, it doesn&#39;t appear in the exported file, thus not in the
-long-term version control.)</p>
-<p class="btxt"><a href="#cmnt_ref2" name="cmnt2">[b]</a>I believe we should allow implementations
-to suppress or defer checks associated with D_I_C, Type_Invariants, and Predicates for types with
-P_I.&nbsp; The definition of &quot;preelaborable&quot; should ignore the presence of D_I_C,
-Type_Invariants, and Predicates, and then an Implementation_Permission should permit suppressing or
-deferring the check.&nbsp; I don&#39;t believe we should *require* that the checks be deferred or
-suppressed -- that seems to be something that could be left up to the compiler vendor in
-consultation with their user base.</p>
 </body></html> 

Questions? Ask the ACAA Technical Agent