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

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

--- ai22s/ai22-0051-1.html	2023/01/13 02:43:47	1.2
+++ ai22s/ai22-0051-1.html	2023/03/23 07:47:03	1.3
@@ -1,4 +1,4 @@
-<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0051-1/02</title>
+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0051-1/03</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}
@@ -19,25 +19,27 @@
 ol.lst-kix_fognbq43wb1d-2.start{counter-reset:lst-ctn-kix_fognbq43wb1d-2 0}
 .lst-kix_fognbq43wb1d-6>li{counter-increment:lst-ctn-kix_fognbq43wb1d-6}
 table td,table th{padding:0}
-.c20{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-c
olor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:437.2pt;border-top-color:#000000;border-bottom-style:solid}
-.c22{margin-left:30.8pt;border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c19{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}
-.c21{height:0pt}
+BODY.body{background-color:#ffffff; max-width:468pt; padding:72pt 72pt 72pt 72pt}
 P.head{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:14pt; padding-bottom:0pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:
400; text-decoration:none; vertical-align:baseline; font-style:normal}
 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.codt{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:10pt; padding-bottom:0pt; font-family:"Courier New",monospace; line-height:1.15; text-align:left; background-color:#f0f0f0; font-weight:400; tex
t-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}
 UL.blts{margin-bottom:0; margin-top:0; margin-left:12pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:12pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15;text-align:left; font-weight:400; text-decorat
ion:none; vertical-align:baseline; font-style:normal; list-style: disc outside}
-P.a3{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-align
:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
-SPAN.a9{background-color:#fffff0; font-size:9.5pt; font-family:"Times New Roman","Times",serif;font-style:italic}
-SPAN.a10{font-family:"Courier New"}
-SPAN.a11{background-color:#fffff0; font-size:9.5pt; font-family:"Times New Roman","Times",serif}
+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.nwo{font-family:"Courier New"}
 </style>
-</head><body class="c19 doc-content"><p class="a3">AI22-0051-1</p>
+</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-01-12 &nbsp;AI22-0051-1/02</p>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;23-03-23 &nbsp;AI22-0051-1/03</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>
@@ -51,19 +53,30 @@
 <p class="text">*** TBD.</p>
 <h2 class="head">!issue</h2>
 
-<p class="text">A Default_Initial_Condition expression is evaluated when a default-initialized
+<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</p>
-<p class="txts">circumvent the purpose of aspect P_I.</p>
+to circumvent the purpose of aspect P_I.</p>
 
 <h2 class="head">!recommendation</h2>
 <p class="txts">*** TBD.</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
+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,
+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>
+
 <h2 class="head">!discussion</h2>
 <p class="txts">This problem occurs in a number of cases, not just Default_Initial_Condition.</p>
 
@@ -94,33 +107,40 @@
 
 <p class="text">&mdash;-</p>
 <p class="text">Possible Solutions:</p>
-<ul class="blts"><li>Allow execution;
-<ul class="bull"><li>The last half of 10.2.1 (1.a) [AARM] says &ldquo;<span class="a9">Some
+<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
 implementations may require run-time code to be executed in some cases, but we consider these cases
 rare enough that we need not further complicate the rules.</span>&rdquo; &mdash; We could consider
 this situation as within these cases, explicitly stating it. </li>
-<li>If this is the default method, then we should have a <span class="a10">Pragma Restrictions(
+<li>If this is the default method, then we should have a <span class="nwo">Pragma Restrictions(
 No_Preelaboration_Execution );</span> (or whatever a good restriction-name would be).</li>
-</ul></li>
-<li>Given 10.2.1 (5.a) ramification illustrates the purpose/function
-(&ldquo;<span class="a11">A </span><span class="a9">preelaborable</span><span class="a11">
+</ul>
+<ul class="bull"><li>Given 10.2.1 (5.a) ramification illustrates the purpose/function
+(&ldquo;<span class="p6s">A </span><span class="so7">preelaborable</span><span class="p6s">
 construct can be elaborated without using any information that is available only at run
 time.</span>&rdquo;), we can require the compiler to statically analyze the conditions, only
-accepting the compilation if some object defaults to those conditions;
-<ul class="bull"><li>Along this line, given a model &lsquo;default&rsquo; object, apply the
+accepting the compilation if some object defaults to those conditions; </li>
+</ul>
+<ul class="buli"><li>Along this line, given a model &lsquo;default&rsquo; object, apply the
 functions [statically(?)] to <i>that</i>, to ensure they hold &ndash; this assumes that the default
 is not dynamic and thus that any object set to that default would conform. (i.e. your value
 doesn&rsquo;t change e.g. from 1 on the first defaulting, to 2 on the second, etc.)</li>
-</ul></li>
-<li>Disallow P_I with D_I_C&rsquo;s containing non-preelaboral properties;
-<ul class="bull"><li>This would require an implementation to check that D_I_C does not violate the
+</ul>
+<ul class="bull"><li>Similar to the above, we could allow (for nonlimited types and types w/o
+&lsquo;Address) construction of a default object, copy into the object declaration, and check the
+object itself when statement execution is available.</li>
+<li>Disallow P_I with D_I_C&rsquo;s containing non-preelaboral properties;</li>
+</ul>
+<ul class="buli"><li>This would require an implementation to check that D_I_C does not violate the
 constraints of Preelaborate; with the addition of static user-function this is less restrictive
 than the 2012 constraints.</li>
-</ul></li>
-<li>Disallow P_I and D_I_C together;</li>
-<li>Ignore D_I_C, using it as a hint for SPARK proof;</li>
+</ul>
+<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="a10">BEGIN</span> associated with the most enclosing declarative-region.)</li>
+<span class="nwo">BEGIN</span> associated with the most enclosing
+declarative-region.)<sup><a href="#cmnt2" name="cmnt_ref2">[b]</a></sup></li>
 </ul>
 
 
@@ -136,21 +156,21 @@
 specification of the Ada.Containers.Vectors package, showing just the parts relevant to this
 discussion:</p>
 
-<a id="t.2356b49c562ccae0b7d02396514589064237165e"></a><a id="t.0"></a><table class="c22"><tr class="c21"><td class="c20">
-<p class="codt"><b>generic</b><br>
- &nbsp; ...<br>
+<p class="cbin"><b>generic</b><br>
+&nbsp; &nbsp;...<br>
 <b>package</b> Ada.Containers.Vectors<br>
- &nbsp; <b>with</b> Preelaborate, ... <b>is</b><br>
- &nbsp; <b>type</b> Vector <b>is</b> <b>tagged</b> <b>private</b><br>
- &nbsp; &nbsp; &nbsp;<b>with</b> ...<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Default_Initial_Condition =&gt;<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Length (Vector) = 0 <b>and</b> then ...,<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Preelaborable_Initialization;</p>
-</td></tr></table><p class="text">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>
+&nbsp; &nbsp;<b>with</b> Preelaborate, ... <b>is</b><br>
+&nbsp; &nbsp;<b>type</b> Vector <b>is</b> <b>tagged</b> <b>private</b><br>
+&nbsp; &nbsp; &nbsp; <b>with</b> ...<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Default_Initial_Condition =&gt;<br>
+&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
+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>
 <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>
@@ -162,4 +182,15 @@
 
 <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