File: AA-1-1-3.html

package info (click to toggle)
ada-reference-manual 20021112web-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 18,652 kB
  • ctags: 8,921
  • sloc: makefile: 52; sh: 20
file content (389 lines) | stat: -rw-r--r-- 27,743 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
    <TITLE>AARM95 - Conformity of an Implementation with the Standard</TITLE>
    <META NAME="Author" CONTENT="JTC1/SC22/WG9/ARG, by Randall Brukardt, ARG Editor">
    <META NAME="GENERATOR" CONTENT="Arm_Form.Exe, Ada Reference Manual generator">
    <STYLE type="text/css">
    DIV.paranum {position: absolute; font-family: Arial, Helvetica, sans-serif; left: 0.5 em; top: auto}
    TT {font-family: "Courier New", monospace}
    DT {display: compact}
    DIV.Normal {font-family: "Times New Roman", Times, serif; margin-bottom: 0.6em}
    DIV.Wide {font-family: "Times New Roman", Times, serif; margin-top: 0.6em; margin-bottom: 0.6em}
    DIV.Annotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
    DIV.WideAnnotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0.6em; margin-bottom: 0.6em}
    DIV.Index {font-family: "Times New Roman", Times, serif}
    DIV.SyntaxSummary {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
    DIV.Notes {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.6em}
    DIV.NotesHeader {font-family: "Times New Roman", Times, serif; margin-left: 2.0em}
    DIV.SyntaxIndented {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
    DIV.Indented {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-bottom: 0.6em}
    DIV.CodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
    DIV.SmallIndented {font-family: "Times New Roman", Times, serif; margin-left:  10.0em; margin-bottom: 0.6em}
    DIV.SmallCodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-bottom: 0.6em}
    DIV.Examples {font-family: "Courier New", monospace; margin-left: 2.0em; margin-bottom: 0.6em}
    DIV.SmallExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left: 7.5em; margin-bottom: 0.6em}
    DIV.IndentedExamples {font-family: "Courier New", monospace; margin-left: 8.0em; margin-bottom: 0.6em}
    DIV.SmallIndentedExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left:  15.0em; margin-bottom: 0.6em}
    UL.Bulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SmallBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SmallNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.IndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.CodeIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.CodeIndentedNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SyntaxIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NotesBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NotesNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    DL.Hanging {font-family: "Times New Roman", Times, serif; margin-top: 0em; margin-bottom: 0.6em}
    DD.Hanging {margin-left: 6.0em}
    DL.IndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.IndentedHanging {margin-left: 2.0em}
    DL.HangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.HangingInBulleted {margin-left: 4.0em}
    DL.SmallHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.SmallHanging {margin-left: 7.5em}
    DL.SmallIndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.SmallIndentedHanging {margin-left: 2.0em}
    DL.SmallHangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.SmallHangingInBulleted {margin-left: 5.0em}
    DL.Enumerated {font-family: "Times New Roman", Times, serif; margin-right: 0.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.Enumerated {margin-left: 2.0em}
    DL.SmallEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.SmallEnumerated {margin-left: 2.5em}
    DL.NestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    DL.SmallNestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    </STYLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFF0" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<P><A HREF="AA-TOC.html">Contents</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-0-29.html">Index</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-1-1-2.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-1-1-4.html">Next</A></P>
<HR>
<H1> 1.1.3 Conformity of an Implementation with the Standard</H1>

<H4 ALIGN=CENTER>Implementation Requirements</H4>
<DIV Class="Paranum"><FONT SIZE=-2>1</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;<A NAME="I1055"></A>A
conforming implementation shall: </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>1.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B><A NAME="I1056"></A>The
<I>implementation</I> is the software and hardware that implements the
language. This includes compiler, linker, operating system, hardware,
etc.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>1.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We first define what it means
to ``conform'' in general -- basically, the implementation has to properly
implement the normative rules given throughout the standard. Then we
define what it means to conform to a Specialized Needs Annex -- the implementation
must support the core features plus the features of that Annex. Finally,
we define what it means to ``conform to the Standard'' -- this requires
support for the core language, and allows partial (but not conflicting)
support for the Specialized Needs Annexes. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>2</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Translate and correctly execute legal programs written
in Ada, provided that they are not so large as to exceed the capacity
of the implementation;</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>3</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Identify all programs or program units that are so large
as to exceed the capacity of the implementation (or raise an appropriate
exception at run time); </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>3.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation defined: </B>Capacity
limitations of the implementation.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Identify all programs or program units that contain errors
whose detection is required by this International Standard; </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>4.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Note that we
no longer use the term ``rejection'' of programs or program units. We
require that programs or program units with errors or that exceed some
capacity limit be ``identified.''  The way in which errors or capacity
problems are reported is not specified.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>An implementation is allowed to
use standard error-recovery techniques. We do not disallow such techniques
from being used across <FONT FACE="Arial, Helvetica">compilation_unit</FONT>
or <FONT FACE="Arial, Helvetica">compilation</FONT> boundaries.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>See also the Implementation Requirements
of <A HREF="AA-10-2.html">10.2</A>, which disallow the execution of illegal
partitions.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Supply all language-defined library units required by this
International Standard; </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>5.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation Note: </B>An
implementation cannot add to or modify the visible part of a language-defined
library unit, except where such permission is explicitly granted, unless
such modifications are semantically neutral with respect to the client
compilation units of the library unit. An implementation defines the
contents of the private part and body of language-defined library units.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>An implementation can add <FONT FACE="Arial, Helvetica">with_clause</FONT>s
and <FONT FACE="Arial, Helvetica">use_clause</FONT>s, since these modifications
are semantically neutral to clients. (The implementation might need <FONT FACE="Arial, Helvetica">with_clause</FONT>s
in order to implement the private part, for example.) Similarly, an implementation
can add a private part even in cases where a private part is not shown
in the standard. Explicit declarations can be provided implicitly or
by renaming, provided the changes are semantically neutral.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><A NAME="I1057"></A>Wherever in
the standard the text of a language-defined library unit contains an
italicized phrase starting with ``<I>implementation-defined</I>'', the
implementation's version will replace that phrase with some implementation-defined
text that is syntactically legal at that place, and follows any other
applicable rules.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Note that modifications are permitted,
even if there are other tools in the environment that can detect the
changes (such as a program library browser), so long as the modifications
make no difference with respect to the static or dynamic semantics of
the resulting programs, as defined by the standard. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Contain no variations except those explicitly permitted
by this International Standard, or those that are impossible or impractical
to avoid given the implementation's execution environment; </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>6.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation defined: </B>Variations
from the standard that are impractical to avoid given the implementation's
execution environment.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Reason: </B>The ``impossible
or impractical'' wording comes from AI-325. It takes some judgement and
common sense to interpret this. Restricting compilation units to less
than 4 lines is probably unreasonable, whereas restricting them to less
than 4 billion lines is probably reasonable (at least given today's technology).
We do not know exactly where to draw the line, so we have to make the
rule vague. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Specify all such variations in the manner prescribed by
this International Standard. </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>8</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;<A NAME="I1058"></A><A NAME="I1059"></A>The
<I>external effect</I> of the execution of an Ada program is defined
in terms of its interactions with its external environment. <A NAME="I1060"></A>The
following are defined as <I>external interactions</I>: </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Any interaction with an external file (see <A HREF="AA-A-7.html">A.7</A>);</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>10</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>The execution of certain <FONT FACE="Arial, Helvetica">code_statement</FONT>s
(see <A HREF="AA-13-8.html">13.8</A>); which <FONT FACE="Arial, Helvetica">code_statement</FONT>s
cause external interactions is implementation defined. </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>10.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation defined: </B>Which
<FONT FACE="Arial, Helvetica">code_statement</FONT>s cause external interactions.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Any call on an imported subprogram (see <A HREF="AA-B.html">Annex
B</A>), including any parameters passed to it;</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>12</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>Any result returned or exception propagated from a main
subprogram (see <A HREF="AA-10-2.html">10.2</A>) or an exported subprogram
(see <A HREF="AA-B.html">Annex B</A>) to an external caller; </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>12.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>By ``result
returned'' we mean to include function results and values returned in
[<B>in</B>] <B>out</B> parameters.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.a.1/1</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>{<I><A HREF="defect2.html#8652/0094">8652/0094</A></I>}
<U>The lack of a result from a program that does not terminate is also
included here.</U> </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>13</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>[Any read or update of an atomic or volatile object (see
<A HREF="AA-C-6.html">C.6</A>);]</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>14</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>The values of imported and exported objects (see <A HREF="AA-B.html">Annex
B</A>) at the time of any other interaction with the external environment.
</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>14.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>To be honest: </B>Also other
uses of imported and exported entities, as defined by the implementation,
if the implementation supports such <FONT FACE="Arial, Helvetica">pragma</FONT>s.
</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15</FONT></DIV>
<DIV Class="Wide">&nbsp;&nbsp;&nbsp;&nbsp;A conforming implementation of this International
Standard shall produce for the execution of a given Ada program a set
of interactions with the external environment whose order and timing
are consistent with the definitions and requirements of this International
Standard for the semantics of the given program. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>There is
no need to produce any of the ``internal effects'' defined for the semantics
of the program -- all of these can be optimized away -- so long as an
appropriate sequence of external interactions is produced. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>See also <A HREF="AA-11-6.html">11.6</A>
which specifies various liberties associated with optimizations in the
presence of language-defined checks, that could change the external effects
that might be produced. These alternative external effects are still
consistent with the standard, since <A HREF="AA-11-6.html">11.6</A> is
part of the standard.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Note also that we only require
``<I>an appropriate</I> sequence of external interactions'' rather than
``<I>the same</I> sequence...'' An optimizer may cause a different sequence
of external interactions to be produced than would be produced without
the optimizer, so long as the new sequence still satisfies the requirements
of the standard. For example, optimization might affect the relative
rate of progress of two concurrent tasks, thereby altering the order
in which two external interactions occur.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Note that RM83 explicitly mentions
the case of an ``exact effect'' of a program, but since so few programs
have their effects defined that exactly, we don't even mention this ``special''
case. In particular, almost any program that uses floating point or tasking
has to have some level of inexactness in the specification of its effects.
And if one includes aspects of the timing of the external interactions
in the external effect of the program (as is appropriate for a real-time
language), no ``exact effect'' can be specified. For example, if two
external interactions initiated by a single task are separated by a ``<B>delay</B>
1.0;'' then the language rules imply that the two external interactions
have to be separated in time by at least one second, as defined by the
clock associated with the <FONT FACE="Arial, Helvetica">delay_relative_statement</FONT>.
This in turn implies that the time at which an external interaction occurs
is part of the characterization of the external interaction, at least
in some cases, again making the specification of the required ``exact
effect'' impractical. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;An implementation that conforms to this Standard
shall support each capability required by the core language as specified.
In addition, an implementation that conforms to this Standard may conform
to one or more Specialized Needs Annexes (or to none). Conformance to
a Specialized Needs Annex means that each capability required by the
Annex is provided as specified. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>The last sentence
defines what it means to say that an implementation conforms to a Specialized
Needs Annex, namely, only by supporting all capabilities required by
the Annex. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;An implementation conforming to this International
Standard may provide additional attributes, library units, and pragmas.
However, it shall not provide any attribute, library unit, or pragma
having the same name as an attribute, library unit, or pragma (respectively)
specified in a Specialized Needs Annex unless the provided construct
is either as specified in the Specialized Needs Annex or is more limited
in capability than that required by the Annex. A program that attempts
to use an unsupported capability of an Annex shall either be identified
by the implementation before run time or shall raise an exception at
run time. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>The last sentence
of the preceding paragraph defines what an implementation is allowed
to do when it does not &quot;conform&quot; to a Specialized Needs Annex.
In particular, the sentence forbids implementations from providing a
construct with the same name as a corresponding construct in a Specialized
Needs Annex but with a different syntax (e.g., an extended syntax) or
quite different semantics. The phrase concerning &quot;more limited in
capability&quot; is intended to give permission to provide a partial
implementation, such as not implementing a subprogram in a package or
having a restriction not permitted by an implementation that conforms
to the Annex. For example, a partial implementation of the package Ada.Decimal
might have Decimal.Max_Decimal_Digits as 15 (rather than the required
18). This allows a partial implementation to grow to a fully conforming
implementation.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>A restricted implementation might
be restricted by not providing some subprograms specified in one of the
packages defined by an Annex. In this case, a program that tries to use
the missing subprogram will usually fail to compile. Alternatively, the
implementation might declare the subprogram as abstract, so it cannot
be called. <A NAME="I1061"></A>Alternatively, a subprogram body might
be implemented just to raise Program_Error. The advantage of this approach
is that a program to be run under a fully conforming Annex implementation
can be checked syntactically and semantically under an implementation
that only partially supports the Annex. Finally, an implementation might
provide a package declaration without the corresponding body, so that
programs can be compiled, but partitions cannot be built and executed.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>To ensure against wrong answers
being delivered by a partial implementation, implementers are required
to raise an exception when a program attempts to use an unsupported capability
and this can be detected only at run time. For example, a partial implementation
of Ada.Decimal might require the length of the Currency string to be
1, and hence, an exception would be raised if a subprogram were called
in the package Edited_Output with a length greater than 1. </FONT></DIV>

<H4 ALIGN=CENTER>Documentation Requirements</H4>
<DIV Class="Paranum"><FONT SIZE=-2>18</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I1062"></A><A NAME="I1063"></A><A NAME="I1064"></A><A NAME="I1065"></A><A NAME="I1066"></A>Certain
aspects of the semantics are defined to be either <I>implementation defined</I>
or <I>unspecified</I>. In such cases, the set of possible effects is
specified, and the implementation may choose any effect in the set. Implementations
shall document their behavior in implementation-defined situations, but
documentation is not required for unspecified situations. The implementation-defined
characteristics are summarized in <A HREF="AA-M.html">Annex M</A>. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>18.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>We used to
use the term ``implementation dependent'' instead of ``unspecified''.
However, that sounded too much like ``implementation defined''. Furthermore,
the term ``unspecified'' is used in the ANSI C and POSIX standards for
this purpose, so that is another advantage. We also use ``not specified''
and ``not specified by the language'' as synonyms for ``unspecified.''
The documentation requirement is the only difference between implementation
defined and unspecified.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>18.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Note that the ``set of possible
effects'' can be ``all imaginable effects'', as is the case with erroneous
execution. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;The implementation may choose to document implementation-defined
behavior either by documenting what happens in general, or by providing
some mechanism for the user to determine what happens in a particular
case. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>For example,
if the standard says that library unit elaboration order is implementation
defined, the implementation might describe (in its user's manual) the
algorithm it uses to determine the elaboration order. On the other hand,
the implementation might provide a command that produces a description
of the elaboration order for a partition upon request from the user.
It is also acceptable to provide cross references to existing documentation
(for example, a hardware manual), where appropriate.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Note that dependence of a program
on implementation-defined or unspecified functionality is not defined
to be an error; it might cause the program to be less portable, however.
</FONT></DIV>

<H4 ALIGN=CENTER>Implementation Advice</H4>
<DIV Class="Paranum"><FONT SIZE=-2>20</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I1067"></A>If an implementation detects
the use of an unsupported Specialized Needs Annex feature at run time,
it should raise Program_Error if feasible. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>20.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Reason: </B>The reason we don't
<I>require</I> Program_Error is that there are situations where other
exceptions might make sense. For example, if the Real Time Systems Annex
requires that the range of System.Priority include at least 30 values,
an implementation could conform to the Standard (but not to the Annex)
if it supported only 12 values. Since the rules of the language require
Constraint_Error to be raised for out-of-range values, we cannot require
Program_Error to be raised instead. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>21</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;If an implementation wishes to provide implementation-defined
extensions to the functionality of a language-defined library unit, it
should normally do so by adding children to the library unit. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>21.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation Note: </B>If
an implementation has support code (``run-time system code'') that is
needed for the execution of user-defined code, it can put that support
code in child packages of System. Otherwise, it has to use some trick
to avoid polluting the user's namespace. It is important that such tricks
not be available to user-defined code (not in the standard mode, at least)
-- that would defeat the purpose. </FONT></DIV>
<DIV Class="NotesHeader"><FONT SIZE=-1>NOTES</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>22</FONT></DIV>
<DIV Class="Notes"><FONT SIZE=-1>2&nbsp;&nbsp;The above requirements
imply that an implementation conforming to this Standard may support
some of the capabilities required by a Specialized Needs Annex without
supporting all required capabilities. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>22.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>A conforming
implementation can partially support a Specialized Needs Annex. Such
an implementation does not conform to the Annex, but it does conform
to the Standard. </FONT></DIV>

<HR>
<P><A HREF="AA-TOC.html">Contents</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-0-29.html">Index</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-1-1-2.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-1-1-4.html">Next</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-TTL.html">Legal</A></P>
</BODY>
</HTML>